I have an application that allows the customer to pick from multiple stat functions to overlay on a graph. I find that of the 10 or so functions that I allow, all work except for "variance" (Steema.TeeChart.Functions.VarianceFunction). When this function is selected, I get a large red X instead of a graph. Further, once I see the red X, switching back to another function (which normally works), fails. Any idea why this is happening.
As a side note, this code was ported from vb6 and version 8, where I just tested the variance function, using basically the same logic and it works fine.
Thanks,
Matt
Variance function producing big red X
-
- Newbie
- Posts: 93
- Joined: Thu Apr 17, 2008 12:00 am
Re: Variance function producing big red X
Hello Matt,
Could you please, send us a simple project because we can reproduce your problem here ?
Thanks,
Could you please, send us a simple project because we can reproduce your problem here ?
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 |
-
- Newbie
- Posts: 93
- Joined: Thu Apr 17, 2008 12:00 am
Re: Variance function producing big red X
Yes, here is a zip containing a sample project.
- Attachments
-
- TeeChartVarianceBug.zip
- sample project
- (42.55 KiB) Downloaded 489 times
Re: Variance function producing big red X
Hello Matt,
I could reproduce your problem and seems it occurs because right axis need be initialized before assign to axis, variance function. Please see next workarounds that I think solve your problem:
Workaround 1:
Workaround 2: Using SetMinMax()
Moreover, I have added it request in bug list with number [TF02015169]. We will try to fix it for next maintenance releases of TeeChart.Net
I hope will helps.
Thanks,
I could reproduce your problem and seems it occurs because right axis need be initialized before assign to axis, variance function. Please see next workarounds that I think solve your problem:
Workaround 1:
Code: Select all
private void InitializeChart()
{
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.Add(0, -206982);
line1.Add(1, 335782001);
line1.Add(2, 616053044);
line1.Add(3, 823145454);
line1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Both;//Workaround
Steema.TeeChart.Styles.Line line2 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line2.Function = new Steema.TeeChart.Functions.VarianceFunction();
line2.DataSource = tChart1[0];
line2.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right;
Code: Select all
private void InitializeChart()
{
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.Add(0, -206982);
line1.Add(1, 335782001);
line1.Add(2, 616053044);
line1.Add(3, 823145454);
Steema.TeeChart.Styles.Line line2 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line2.Function = new Steema.TeeChart.Functions.VarianceFunction();//Average works fine and Variance with version 3 too.
line2.DataSource = tChart1[0];
tChart1.Axes.Right.SetMinMax(0, tChart1[1].MaxYValue() * 2); //Workaround
line2.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right; //I think problem is here.
}
I hope will helps.
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 |
-
- Newbie
- Posts: 93
- Joined: Thu Apr 17, 2008 12:00 am
Re: Variance function producing big red X
Thanks, the second work around appears to work.