cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

X-Axis Labelling

Former Member
0 Likes
236

Hi All,

I want to write a javascript for an iChart Applet where i can define the gap after which x-axis label should appear.

For example, if i am plotting a chart of population in a country for all year. I want to show all the bars for 12 months, however, i want to display labels for 1st, 4th, 7th, 10th, 12th bar only. So, that the chart looks neat.

Thanks.

View Entire Topic
Former Member
0 Likes

Hi Claude,

The suggestion given above will work, but for that we have to hard code custom strings.If the objective is just to give a clean representation,then instead of giving alternate lables we can use the depth label feature of the graph.In this the labels will be displayed in a manner which gives a clear and neat picture.

It can be handled from javascript.

var objChart = document.appPopulation.getChartObject(); // appPopulation is the name of the applet

now chart object is assigned to variable objChart. then do

objChart.setXAxisLabelDepth(2); // depth can be set to 2,3,4 ... that defines the depth level

document.appPopulation.refresh();

then clear the java console and refersh the applet.

This will set the depth for the labels.So there will not be any overlapping of labels.

Regards

Pradeep