Page 1 of 1

data Section

Posted: Thu May 05, 2011 1:59 pm
by 9641422
Hello
i m using .Net Tchart V2 in MFC C++ CLI project.
Our requirement: i wanted to export data teechart to text file but instead of X, Y header i wanted to show some other header in to text file.
Steps: -
1/ Create a chart.
2/ Add a Bar Series.
3/ Add random data.
4/ Export data in to text file

Exported Output in text file
X Y
12 1333
11 1234
14 1111
... ......

In editor --> data Section --> i wanted to put instead of X, Y some other header.
i wanted to change series --> data section header (X, Y).

In Editor --> Data
Required output in text file

Text1 Text 2
12 1333
11 1234
14 1111
..... ......


Question 2 : what is relation between datasource and data section ? .
Question 3: in Editor --> Data Section It takes default header for a specific series ? how we can change it?

Re: data Section

Posted: Fri May 06, 2011 11:21 am
by 10050769
Hello Amol,
Question 2 : what is relation between datasource and data section ?
Basically difference there are with between Data section and Datasource is that the first is a table where there are x and y values modifiable data and DataSource is the data that form the series.
Question 3: in Editor --> Data Section It takes default header for a specific series ? how we can change it?
If you want change the name of header of specific series I recommend you change Name property of Series.ValueList[x] as do in next simple code:

Code: Select all

        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            //InitializeChart.
            Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
           bar1.FillSampleValues();
           bar1.ValuesLists[0].Name = "X";
           bar1.ValuesLists[1].Name = "Y";
}
On the other hand, when you export it to Data file, as you have said data is not export as expected. We could reproduce your problem in last version 4 of TeeChart.Net and we have added it in wish-list report with number [TF02015559] to be consider included in next maintenance releases of TeeChart.Net.

Thanks,

Re: data Section

Posted: Tue May 10, 2011 2:09 pm
by 10050769
Hello Amol,

Seems I didn't realize that this feature request (TF02015559) already is in last version of TeeChart.Net. If you want that export your data correctly, you need do something as next:

Code: Select all

  private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            bar1.FillSampleValues();
            bar1.ValuesLists[0].Name = "My X";
            bar1.ValuesLists[1].Name = "My Y";
            tChart1.Export.Data.Text.IndexFieldName = bar1.ValuesLists[0].Name; //CDI here
            tChart1.Export.Data.Text.IncludeIndex = true;
            tChart1.Export.Data.Text.IncludeHeader = true;
            tChart1.Export.Data.Text.Save(@"c:\tmp\Chart1Data.txt");
        }
Could you confirm that previous code works as you expect?

Thanks,