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

Message ListMessage List     Post MessagePost Message

  Line XY char with X irregular scale like image
Posted by Gabriel Gra on Nov-11-2014 21:11
Attachments:
Hello Guys,

Is it possible do something like the image (without the black area) ?

The X scale when it's between 500 and 1000 have a 750 value with a lower line space.

thank you.

Gabriel Gra
audiometrico.png

  Re: Line XY char with X irregular scale like image
Posted by Peter Kwan on Nov-12-2014 01:01
Attachments:
Hi Gabriel,

Yes, ChartDirector can create similar scale. In C#, the code is like:

// x-axis scale is from 125 to 8000, with some margins before 125 and after 8000,
// with no ticks and with the x-axis on top
c.xAxis().setLogScale2(125, 8000, null);
c.xAxis().setMargin(c.getPlotArea().getWidth() / 14, c.getPlotArea().getWidth() / 14);
c.xAxis().setTickLength(0, 0);
c.setXAxisOnTop();

// The top row of labels, using bold font and shifted upwards for 15 pixels
double[] topLabels = { 125, 250, 500, 1000, 2000, 4000, 8000};
for (int i = 0; i < topLabels.Length; ++i)
    c.xAxis().addMark(topLabels[i], 0x000000, "<*yOffset=15*>" + topLabels[i], "Times New
Roman Bold", 10).setDrawOnTop(false);

// The bottom row of labels, using dash lines as grid lines
double[] otherLabels = {750, 1500, 3000, 6000};
for (int i = 0; i < otherLabels.Length; ++i) {
Mark m = c.xAxis().addMark(otherLabels[i], -1, "" + otherLabels[i], "Arial");
m.setDrawOnTop(false);
m.setMarkColor(c.dashLineColor(0x000000, Chart.DashLine), 0x000000);
}

Hope this can help.

Regards
Peter Kwan
xscale.png

  Re: Line XY char with X irregular scale like image
Posted by Gabriel Gra on Nov-12-2014 03:38
Thank you!

It Works fine!