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

Message ListMessage List     Post MessagePost Message

  How to change x-axis position in Scatterlayer
Posted by Sam on Feb-03-2018 12:21
Attachments:

Hi,

I am using the scatterlayer to draw the bubble chart, for the x-axis values i am passing as null and displaying the labels alone, But the labels displaying from the 0th position if i want to adjust to different position how do i do that. I have attached the image with my actual and expected result for your reference. Could some one help me to how to solve this.

c.addScatterLayer(null, throughPut, "Throughput", Chart.CircleSymbol, 10, 0x80ff3333, 0x80ff3333);
xaxis-values-position.png

  Re: How to change x-axis position in Scatterlayer
Posted by Peter Kwan on Feb-05-2018 17:29
Hi Sam,

If you want to add some margin to the left and right sides of the x-axis, you can use Axis.setMargin. For example:

// margin = 30 pixels
c.xAxis().setMargin(30, 30);

or (in Java):

// margin = half the distance between points
int margin = c.getPlotArea().getWidth() / throughPut.length / 2;
c.xAxis().setMargin(margin, margin);

Hope this can help.

Regards
Peter Kwan

  Re: How to change x-axis position in Scatterlayer
Posted by Sam on Feb-06-2018 08:05
Hi Peter,

Thanks for your suggestion. It's working as i expected.

Thanks
Sam