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

Message ListMessage List     Post MessagePost Message

  Extending yAxis
Posted by Martyn Matthews on Jul-17-2013 01:57
I am creating an XYChart, adding an HLOC layer to it, then adding two further LineLayers (similar to Bollinger bands).
The chart shows all the HLOC values, but sometimes the extreme values of one or other of the LineLayers are clipped.
I've tried extending the yAxis using yAxis().setLinearScale, to ensure that the yAxis covers the values at the extremes of the two LineLayers, but this doesn't seem to work.

The code is:
    Set c1 = cd.XYChart(ChartWidth, ChartHeight)
    Set NormalLayer = c1.addHLOCLayer(mHigh, mLow, mOpen, mClose)
    c1.setPlotArea 15, 10, ChartWidth - 100, ChartHeight - 80
    c1.setYAxisOnRight (True)
    c1.yAxis().setLinearScale cd.ArrayMath(mKeltnerBottom).Min, cd.ArrayMath(mKeltnerTop).Max
    Set LineLayer1 = c1.addLineLayer(mKeltnerTop, &HDDDD)
    Set LineLayer2 = c1.addLineLayer(mKeltnerBottom, &HDDDD)

How can I get all of the LineLayer points to show, please?

  Re: Extending yAxis
Posted by Peter Kwan on Jul-17-2013 03:37
Hi Martyn,

ChartDirector should auto-scale the y-axis to ensure all data points are shown. You should need to do anything.

Set c1 = cd.XYChart(ChartWidth, ChartHeight)
Set NormalLayer = c1.addHLOCLayer(mHigh, mLow, mOpen, mClose)
c1.setPlotArea 15, 10, ChartWidth - 100, ChartHeight - 80
c1.setYAxisOnRight (True)
Set LineLayer1 = c1.addLineLayer(mKeltnerTop, &HDDDD)
Set LineLayer2 = c1.addLineLayer(mKeltnerBottom, &HDDDD)

If you think the lines are clipped, is it possible to attach the actual chart obtained using the above code? I will examine it to see if I can find any clue.

Regards
Peter Kwan

  Re: Extending yAxis
Posted by Martyn Matthews on Jul-17-2013 14:47
Thank you!