Scrollpager problem adding a serie without values
Scrollpager problem adding a serie without values
If I add a new serie and I want to see it in the scrollpager but I have not add values yet the chart is deleted.
Please find here the example, press button1 to add the scrollpager and then button3 to add a new serie.
http://193.145.251.126/pnp/files/yCltRj ... Scroll.zip
Thanks
Please find here the example, press button1 to add the scrollpager and then button3 to add a new serie.
http://193.145.251.126/pnp/files/yCltRj ... Scroll.zip
Thanks
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Scrollpager problem adding a serie without values
Possibly the easiest way to resolve this is to check if the series has points before assigning it to the tool's Series property, e.g.wakeup wrote:If I add a new serie and I want to see it in the scrollpager but I have not add values yet the chart is deleted.
Code: Select all
if (tool != null && tChart1.Series[tChart1.Series.Count - 1].Count > 0)
{
tool.Series = null;
for (int i = 0; i < tChart1.Series.Count; i++)
tool.Series = tChart1.Series[i];
}
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: Scrollpager problem adding a serie without values
Yes, but I need to have the scrollpager ready if the user load values... I know I can do tricks but isn't it a bug?
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Scrollpager problem adding a serie without values
If the user loads values, the series count will be greater than 0 (zero) and the code will execute without a problem.wakeup wrote:Yes, but I need to have the scrollpager ready if the user load values... I know I can do tricks but isn't it a bug?
Assigning a Series without any points in it to the tool.Series value means that the chart bottom axis values are set to the maximum and minimum XValues of the series; given that both of these will be 0 (zero), then I would say that the chart behaves as expected.
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: Scrollpager problem adding a serie without values
Without scrollpager it is not a problem. And if you do it although you try to load data the chart doesn't run...Christopher wrote:Assigning a Series without any points in it to the tool.Series value means that the chart bottom axis values are set to the maximum and minimum XValues of the series; given that both of these will be 0 (zero), then I would say that the chart behaves as expected.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Scrollpager problem adding a serie without values
What is not a problem without a scrollpager?wakeup wrote:Without scrollpager it is not a problem.
Can you please pass me some code to show me what you mean here?wakeup wrote:And if you do it although you try to load data the chart doesn't run...
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: Scrollpager problem adding a serie without values
To have a serie without points in a chart is not a problem for the chart, so I think it shouldn't by a problem for the scrollpager...Christopher wrote:What is not a problem without a scrollpager?wakeup wrote:Without scrollpager it is not a problem.
http://193.145.251.126/pnp/files/RAzDuu ... Scroll.zipChristopher wrote:Can you please pass me some code to show me what you mean here?wakeup wrote:And if you do it although you try to load data the chart doesn't run...
Button 1, button 3 and after button 6
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Scrollpager problem adding a serie without values
The difference is that scrollpager has a Series property which determines how the chart is painted. If the Series assigned to the series property has no points, then the maximum and minimum bottom axis values will be set to zero.wakeup wrote:To have a serie without points in a chart is not a problem for the chart, so I think it shouldn't by a problem for the scrollpager...
Try:wakeup wrote: http://193.145.251.126/pnp/files/RAzDuu ... Scroll.zip
Button 1, button 3 and after button 6
Code: Select all
private void button6_Click(object sender, EventArgs e)
{
for (int i = 0; i < tChart1.Series.Count; i++)
{
tChart1.Series[i].FillSampleValues();
tool.Series = tChart1.Series[i];
}
}
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 |