Hi ,
I have a fastline chart that loops back on itself with the following points:
var dblIndex= new double[30] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, 16, 17, 18, 19,20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 };
// Temperature
var dblXData= new double[30] { 100, 110 ,120 ,130 ,140, 150 ,160 ,170, 180, 180, 170, 160, 150, 140, 130, 100, 110, 120, 130, 140, 150, 160, 170, 180, 180, 170, 160, 150, 160, 170 };
// Power
var dblYData= new double[30] { 0, 0, -3, -10, -7, -5, -3, -2, 0, 0, 2, 3, 7, 5, 3 , 0, -1, -4, -11, -8, -6, -4, -3, -1, -1, 3, 4, 8, 6, 4 };
However if I change my axis limits to 128 to 165, the chart cuts off alot of data.
I noticed that this has something to do with the X value of the last point in the series and that this behaviour can be overridden by setting the Fastline->calcVisiblePoints boolean to *false*. However this is a protected field so I cant do this programmatically.
Am I doing something incorrect here?
FastLine not showing all plots
FastLine not showing all plots
- Attachments
-
- Data missing when limits are 128 to 165
- Axis 128 to 165.jpg (71.99 KiB) Viewed 9573 times
-
- All data visible when x axes limits are 128 to 182
- Axis 128 to 182.jpg (102.1 KiB) Viewed 9570 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: FastLine not showing all plots
Hello!
which gives me:
I think you should be able to get what you want by setting the Order of the ValueLists to None, e.g.HotStage wrote: I noticed that this has something to do with the X value of the last point in the series and that this behaviour can be overridden by setting the Fastline->calcVisiblePoints boolean to *false*. However this is a protected field so I cant do this programmatically.
Am I doing something incorrect here?
Code: Select all
private void InitializeChart()
{
var dblXData = new double[30] { 100, 110, 120, 130, 140, 150, 160, 170, 180, 180, 170, 160, 150, 140, 130, 100, 110, 120, 130, 140, 150, 160, 170, 180, 180, 170, 160, 150, 160, 170 };
// Power
var dblYData = new double[30] { 0, 0, -3, -10, -7, -5, -3, -2, 0, 0, 2, 3, 7, 5, 3, 0, -1, -4, -11, -8, -6, -4, -3, -1, -1, 3, 4, 8, 6, 4 };
FastLine series = new FastLine(tChart1.Chart);
series.XValues.Order = ValueListOrder.None;
series.YValues.Order = ValueListOrder.None;
series.Add(dblXData, dblYData);
tChart1.Axes.Bottom.SetMinMax(128, 165);
}
Best Regards,
Christopher Ireland / 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: FastLine not showing all plots
Hi Christopher,
Is it possible to manually define a subset of points to plot?
For example, would it be possible to only show points 4 to 7?
Is it possible to manually define a subset of points to plot?
For example, would it be possible to only show points 4 to 7?
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: FastLine not showing all plots
Hello,
Yes, it is - we can work directly with the arrays the series draws with code similar to the following:HotStage wrote:
Is it possible to manually define a subset of points to plot?
For example, would it be possible to only show points 4 to 7?
Code: Select all
FastLine series;
double[] dblXData, dblYData;
private void InitializeChart()
{
dblXData = new double[30] { 100, 110, 120, 130, 140, 150, 160, 170, 180, 180, 170, 160, 150, 140, 130, 100, 110, 120, 130, 140, 150, 160, 170, 180, 180, 170, 160, 150, 160, 170 };
// Power
dblYData = new double[30] { 0, 0, -3, -10, -7, -5, -3, -2, 0, 0, 2, 3, 7, 5, 3, 0, -1, -4, -11, -8, -6, -4, -3, -1, -1, 3, 4, 8, 6, 4 };
series = new FastLine(tChart1.Chart);
series.XValues.Order = ValueListOrder.None;
series.YValues.Order = ValueListOrder.None;
series.Add(dblXData, dblYData);
tChart1.Axes.Bottom.SetMinMax(128, 165);
}
private void button1_Click(object sender, EventArgs e)
{
var newX = dblXData.Skip(3).Take(4).ToArray();
var newY = dblYData.Skip(3).Take(4).ToArray();
series.XValues.Count = newX.Count();
series.YValues.Count = newY.Count();
series.XValues.Value = newX;
series.YValues.Value = newY;
tChart1.Invalidate();
}
Best Regards,
Christopher Ireland / 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 |