Hi,
I am using teechart wpf 4.1.2012.1312 version.
I need to bind the csv file data into teechart where csv file can contain time(on teechart x axis) and pressure(on teechart y axis) values.
I have problem in binding csv file data.
Please help me to show csv file data on teechart.
Thanks in advance.
csv file data on teechart wpf 4.1.2012.1312 version
Re: csv file data on teechart wpf 4.1.2012.1312 version
Hello gilbert,
You can use TextSource and do something as do in next lines of code to import the .csv file I have attached:
Could you tell us if previous code works in your end?
Thanks,
You can use TextSource and do something as do in next lines of code to import the .csv file I have attached:
Code: Select all
public MainWindow()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.WPF.Styles.Line Series1;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
//Auxiliar series.
Series1 = new Steema.TeeChart.WPF.Styles.Line(tChart1.Chart);
//Read Text File
Steema.TeeChart.WPF.Data.TextSource ts = new Steema.TeeChart.WPF.Data.TextSource(@"C:\Test.csv");
ts.HeaderLines = 1;
ts.DecimalSeparator = '.';
ts.Separator = ' ';
ts.Fields.Add(0, "Y");
//Assign Text File to Series1;
Series1.DataSource = ts;
Series1.XValues.DataMember = "X";
Series1.YValues.DataMember = "Y";
}
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: csv file data on teechart wpf 4.1.2012.1312 version
Thank you Sandra.
how can we show multiple series on teechart at a time from different csv files.
Also please let me know how can I customize the values on x axis and y axis.
how can we show multiple series on teechart at a time from different csv files.
Also please let me know how can I customize the values on x axis and y axis.
Re: csv file data on teechart wpf 4.1.2012.1312 version
Hello gilbert,
If you want use multiple series and import its values from different .csv files I recommend you use multiple TextSource to import the .csv files, you can do something as next:
I have attached other file data .csv, because you can make the test with my code.
Thanks,
If you want use multiple series and import its values from different .csv files I recommend you use multiple TextSource to import the .csv files, you can do something as next:
Code: Select all
private Steema.TeeChart.WPF.Styles.Line Series1,Series2;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
//Auxiliar series.
Series1 = new Steema.TeeChart.WPF.Styles.Line(tChart1.Chart);
Series2 = new Steema.TeeChart.WPF.Styles.Line(tChart1.Chart);
//Read Text Files
Steema.TeeChart.WPF.Data.TextSource ts = new Steema.TeeChart.WPF.Data.TextSource(@"C:\Test.csv");
Steema.TeeChart.WPF.Data.TextSource ts1 = new Steema.TeeChart.WPF.Data.TextSource(@"C:\Test1.csv");
ts.HeaderLines = 1;
ts.DecimalSeparator = '.';
ts.Separator = ' ';
ts.Fields.Add(0, "Y");
ts1.HeaderLines = 1;
ts1.DecimalSeparator = '.';
ts1.Separator = ' ';
ts1.Fields.Add(0, "Y");
//Assign Text File to Series1;
Series1.DataSource = ts;
Series1.XValues.DataMember = "X";
Series1.YValues.DataMember = "Y";
//Assign Text File to Series2;
Series2.DataSource = ts1;
Series2.XValues.DataMember = "X";
Series2.YValues.DataMember = "Y";
}
If you want use custom values to axis x and y you can use SetMinMax() method, for each axis. On the other hand, I recommend taking a look in the TeeChartFor.Net Demo project, concretely in All Features\Welcome !\Axes. The examples, were made in Winforms but all funcionalities should work fine in the wpf projectsAlso please let me know how can I customize the values on x axis and y axis.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: csv file data on teechart wpf 4.1.2012.1312 version
Thank you Sandra.