ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Chart line is displaying beyond the points
Posted by John on Apr-25-2013 18:31
Attachments:
Hi,

While drawing plot the  chart line is displaying beyond the points and  the line is touching the plot boundaries..

Please suggest and here attached screenshot for your reference.

here my snipped code.


XYChart ^c = gcnew XYChart(780, 700);
c->addScatterLayer(............);
trend0 = c->addTrendLayer2(.....);


Thanks In Advance,
John
Line.png

  Re: Chart line is displaying beyond the points
Posted by Peter Kwan on Apr-26-2013 01:05
Hi John,

If you use addLineLayer, the line will join the data points, and will not extend beyond the points. For an example, see:

http://www.advsofteng.com/doc/cdnet.htm#unevenpoints.htm

If you use addTrendLayer, ChartDirector will compute a line that best fit the data points. The line may not join pass through any data point at all. For an example, see:

http://www.advsofteng.com/doc/cdnet.htm#scattertrend.htm

For the addTrendLayer, as the line may not pass through any data point, it will extend until it reaches the border of the plot area. The trend layer is most often used to determine the "trend", so most people find it useful to extend the line. Also, ChartDirector cannot know where is the boundary of your data. It can be the horizontal data range or vertical data range. (ChartDirector allows your like to flow from left to right, and it also supports line that flows from up to down or any other random direction.) So ChartDirector will not automatically limit the trend line horizontally or vertically (or in some other direction).

If you would like to use the addTrendLayer, but want to limit the line to certain range, you may use an x-zone color as the line color. For example, see:

http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&thread=1201231484#N1201249775

http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&thread=1350662452

Hope this can help.

Regards
Peter Kwan