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

Message ListMessage List     Post MessagePost Message

  Please help! Is it possible to align the scale of secondary axis with data point on xyChart?
Posted by Yalin on Jun-14-2012 16:44
Attachments:
Hi all:

I'm using C# on setting the scales of secondary asix along with data points on a xy-chart like attached pic shown. lables(A,B,C,D and E) are mapping to its corresponding data point on PLAN asix)

I'm wonder if it is possible because I've checked all functions included in xAxis2() API. For example, setLabelGap() only allows to set an equal distanct between each axis lable.

Please help me if there is any other soluction, thanks a lot.
xyChart-X-Axis2.jpg

  Re: Please help! Is it possible to align the scale of secondary axis with data point on xyChart?
Posted by Peter Kwan on Jun-15-2012 00:35
Hi Yalin,

You can use the top x-axis and then use Axis.addMark to add the labels to any position you like. For example:

c.xAxis2().syncAxis(c.xAxis());   //The top x-axis has the same scale as the bottom x-axis
c.xAxis2().setColors(Chart.Transparent, Chart.Transparent);  //hide original labels

string[] myLabels = {"A", "B", "C", "D", "E"};
for (int i = 0; i < 5; ++i)
   c.xAxis2().addMark(myXData[i], -1, myLabels[i]).setMarkColor(Chart.Transparent, 0x000000, Chart.Transparent);

Hope this can help.

Regards
Peter Kwan

  Re: Please help! Is it possible to align the scale of secondary axis with data point on xyChart?
Posted by Yalin on Jun-15-2012 14:47
Attachments:
Thanks Kwan, it's a clever idea!

But I have another question:

In this case, does ChartDirector support drawing "scale line" for mark on axis?

Or maybe I need to get the x y coordinate of each mark for drawing its corresponding tick?
I show it on the picture, thanks.
xyChart-X-Axis3.jpg

  Re: Please help! Is it possible to align the scale of secondary axis with data point on xyChart?
Posted by Yalin on Jun-15-2012 18:32
I've solved this issue by myself.

by using:

for (int i = 0; i < MeasurePointsWithWafer.Count; i++)
                {
                   Mark aMark = chart.xAxis2().addMark(DataX[i], 1, DataY[i]);
                   aMark.setMarkColor(Chart.Transparent, 0x000000, 0x000000);
                }