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

Message ListMessage List     Post MessagePost Message

  Guidelines extend beyond chart borders
Posted by Mike on Apr-02-2014 20:37
Attachments:
I create guidelines on a chart so end users can see when their production reaches certain
tiers.  I do this by adding a line with first x value equal 0, last x value equal to the tier
threshold, and a bunch of NoValue points in between.

This works great except the lines extend beyond the border of the chart, as seen below.

How can I get the lines to terminate at the y-axis limit?  I suppose I could do it by
calculating the point at which the guideline will hit the y-axis, but that seems like a lot of
needless coding for something that should occur by default.  I'm guessing I'm just missing
something.

Any help is appreciated.
Chart.png

  Re: Guidelines extend beyond chart borders
Posted by Peter Kwan on Apr-02-2014 21:08
Hi Mike,

Normally, ChartDirector would auto-scale the y-axis to ensure no data point can fall outside
the axis range.

If a line goes outside of the axis range, normally it is because the y-axis is not auto-scaled
(fixed by code to a certain range), or the line is added after the axis scale has been fixed
(by layout or layoutAxes). In this case, you may use XYChart.setClipping to ask
ChartDirector to clip the layers to the plot area. For example, in C#/Java, it is like:

c.setClipping();

Hope this can help.

Regards
Peter Kwan

  Re: Guidelines extend beyond chart borders
Posted by Mike on Apr-02-2014 21:13
Brilliant, Peter.  Worked like a charm.  Thank you.