|
Renumbering y-axis with "wrong" values |
Posted by David Littau on Aug-13-2011 03:40 |
|
I have been tasked with duplicating a chart that appears in another program. The chart has non-conforming marking on the y-axis, in that the middle of the y axis is marked -80 and both above and below that -80 are marks for -70, -60, -50, etc. I know it would not be possible to graph using these values, because it's not obvious where a point should be drawn. I don't know how it was done in the original because I don't have the source code for it.
Is it possible to change the y-axis marks after the data has been charted so that the values are different?
thanks,
David |
Re: Renumbering y-axis with "wrong" values |
Posted by Peter Kwan on Aug-13-2011 23:22 |
|
Hi David,
The labels on the axis is only for human reading. They do not need to mean anything to ChartDirector. You can use anything you like as the labels, even names like ("High", "Medium", "Low", "Red", "Green", "17", "20/2/2022", "Mon", ...). You can definitely use ("-50", "-60", "-70", "-80", "-70", "-60", "-50") as the labels. The labels does not need to correspond to the axis scale in anyway.
The purpose of the axis scale is to allow your code to inform ChartDirector where to plot a point. For example, if the y-axis scale is from 0 - 100, and your data point is at y = 50, ChartDirector knows that the point in the middle of the plot area.
If you would like to use an axis scale of 0 - 100 for positioning the points, and to spread the labels ("-50", "-60", "-70", "-80", "-70", "-60", "-50") at the position 0 to 100, the code is like:
c.yAxis().setLinearScale2(0, 100, new string[] { ("-50", "-60", "-70", "-80", "-70", "-60", "-50" });
Hope this can help.
Regards
Peter Kwan |
Re: Renumbering y-axis with "wrong" values |
Posted by David Littau on Aug-14-2011 01:44 |
|
Thank you. That should solve the problem for me. |
|