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

Message ListMessage List     Post MessagePost Message

  Muliple Y-Axises with same Zero point in the Middle
Posted by Olaf on Aug-16-2011 19:52
Attachments:
Hello,
i have a Chart with two or more Axes.
I want to use Autoscaling, but I also want to have the Zero-Line at the Same point for all Axes. Best would be in the Middle of the Chart.

The different Curves must be comparable according to their Zero points.
How can that be achieved?

To Explain what I mean . I have attached two Charts the second is an Example of how it should be.

Olaf
yNotOK.gif
yOK.gif

  Re: Muliple Y-Axises with same Zero point in the Middle
Posted by Peter Kwan on Aug-17-2011 00:32
Hi Olaf,

ChartDirector always auto-scale the axes independently. For your case, the method I think of is to add a transparent and "negative" version of all your data layers. It is like (in Java/C#):

LineLayer layer = c.addLineLayer(myYData, ....);
layer.setXData(myXData);
layer.setUseYAxis(....);

//add a transparent negative version
Layer dummy = c.addScatterLayer(myXData, new ArrayMath(myYData).mul(-1).result(), Chart.Transparent);
dummy.setUseYAxis(....);
dummy.setHTMLImageMap("{disable}"); //only required if you are using image map

Using the above method, the data for every axis are symmetrial (there are always a positive version and a negative version), and so every axis will be symmetrial with the zero point in the middle.

Hope this can help.

Regards
Peter Kwan