|
Setting the beginning and the end point of different trendlines |
Posted by Umit Tumkaya on Oct-20-2009 15:10 |
|
Hi;
I'm trying to draw several trendlines on the same x and y axises. But the related parts of the x-axis for each trendline varies due to the trendline. I want each trendline to begin from the first data and end at the last data of the array(x axis).
My second trendline's( trendSQ1 ) x-axis begins at "1" and ends at "5" but because the first trendline( trendUcret ) uses a x-axis from "1" to "10", also the second trendline is plotted from "1" to "10".
The code (C#, ASP.NET) is below;
XYChart c = new XYChart(650, 350, 0xeeeeee, 0x000000, 1);
TrendLayer trendUcret = c.addTrendLayer(kademe, ucret, 0x00FF0000);
trendUcret.setRegressionType(1);
TrendLayer trendSQ1 = c.addTrendLayer(skalaKademe, skalaQ1, 0x6666ff);
trendSQ1.setRegressionType(1);
Thanks
Umit. |
Re: Setting the beginning and the end point of different trendlines |
Posted by Peter Kwan on Oct-21-2009 00:23 |
|
Hi Umit,
In ChartDirector, a trend line adding using addTrendLayer will extend until it meets the border of the plot area. Do you mean you want the first trend line to stop at x = 4 (for label based x-axis, in ChartDirector, the x-axis coordinates start from 0)? The code to do this is:
TrendLayer trendUcret = c.addTrendLayer(kademe, ucret, c.xZoneColor(4, 0x00FF0000, Chart.Transparent));
trendUcret.setRegressionType(1);
The c.xZoneColor(4, 0x00FF0000, Chart.Transparent) means the color is red for x <= 4, and transparent for x > 4. So visually the trend line will terminate at x = 4.
Hope this can help.
Regards
Peter Kwan |
Re: Setting the beginning and the end point of different trendlines |
Posted by Umit Tumkaya on Oct-21-2009 21:35 |
|
Thank you very much.
I solved the problem. |
|