Hi sandra,
I need to show multiple fastline series on teechart from csv file.
For which I need to customize the teechart left axis and bottom axis values ie.
The axis values should be constant and they should not be any change in the increment on their label values as series differ in their data source.
Example :
On bottom axis, I would like to show the time values 11:00, 12:00, 13:00, 14:00, 15:00 with time interval of 1 hour.
On Left axis,I would like to show 100, 200, 300, 400,500 with constant increment of 100.
I want to show the multiple fastline series one by one with certain data within the above range of bottom and left axis values on teechart
without any change in left or bottom axis label values. i.e.,dynamically I want to show 2 to 3 lines on teechart one by one without clearing existing series.
Also I need to limit values on the teechart left axis(y axis) to 3 or 5 etc.
Please suggest me the solution.
Teechart wpf left axis and bottom axis
Re: Teechart wpf left axis and bottom axis
Hello gilbert,
Could you tell us if previous code works in your end?
Thanks,
As explained in this thread, to work with multiple fastlines and populate series importing data from .csv files, you can use TextSource component for each file.I need to show multiple fastline series on teechart from csv file.
I think to achieve as you want, you can use a similar code as next. Remember use your .csv files:For which I need to customize the teechart left axis and bottom axis values ie.
The axis values should be constant and they should not be any change in the increment on their label values as series differ in their data source.
Example :
On bottom axis, I would like to show the time values 11:00, 12:00, 13:00, 14:00, 15:00 with time interval of 1 hour.
On Left axis,I would like to show 100, 200, 300, 400,500 with constant increment of 100.
I want to show the multiple fastline series one by one with certain data within the above range of bottom and left axis values on teechart
without any change in left or bottom axis label values. i.e.,dynamically I want to show 2 to 3 lines on teechart one by one without clearing existing series.
Also I need to limit values on the teechart left axis(y axis) to 3 or 5 etc.
Please suggest me the solution.
Code: Select all
public MainWindow()
{
InitializeComponent();
InitializeChart();
}
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");
Series1.XValues.DateTime = true;
//Assign Text File to Series1;
Series1.DataSource = ts;
Series1.XValues.DataMember = "X";
Series1.YValues.DataMember = "Y";
Series2.XValues.DateTime = true;
//Assign Text File to Series2;
Series2.DataSource = ts1;
Series2.XValues.DataMember = "X";
Series2.YValues.DataMember = "Y";
tChart1.Axes.Bottom.Labels.DateTimeFormat = "hh:mm";
tChart1.Axes.Bottom.Increment = Steema.TeeChart.WPF.Utils.GetDateTimeStep(Steema.TeeChart.WPF.DateTimeSteps.OneHour);
tChart1.Axes.Left.SetMinMax(100, 1000);
}
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 |