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

Message ListMessage List     Post MessagePost Message

  How to change the axes lables
Posted by Sachin Patil on Feb-21-2014 13:43
Attachments:
I want the city graph as like the Aggregate graph as shown in the image attached, but I
am able to do that.
The problems I am facing are as follows.
1) How to set the labels (in percentage) on Y- Axis as they are shown in Aggregate graph
2) How to make sure that x axis labels are not overlapping
3) As I am having negative percentage also so how can I plot the X-Axis in between +ve
and -ve values on Y-Axis.
graph.png

  Re: How to change the axes lables
Posted by Peter Kwan on Feb-21-2014 23:41
Hi Sachin,

1. I assume the 0.1 label on the y-axis really refer to 10% (and not 0.1%). In this case, the
y label format is the actual value, times 100, and append the "%" character at the end. The
format string is therefore "{={value}*100}%". The code is like:

c.yAxis().setLabelFormat("{={value}*100}%");

2. You may use Axis.setLabelStyle to rotate the labels by 45 degrees. The "Candlestick
Chart" sample code illustrates this. It is like:

c.xAxis().setLabelStyle("Arial Bold", 8, 0x000000, 45);

3. The method is XYChart.setAxisAtOrigin. The sample code "4 Quadrant Chart" is a chart
with an x-axis in between +ve and -ve values on Y-Axis. For your case, the code is like:

c.setAxisAtOrigin(Chart.XAxisAtOrigin);

Hope this can help.

Regards
Peter Kwan