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

X-Axis Labelling

Former Member
0 Likes
237

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
jcgood25
Active Contributor
0 Likes

Claude,

By default, the iChart will always display a label for the first and last item, so in your example the 1st and 12th bars should have one, and bar mode will typically show a label for each bar. If you change your XAxisTicksPerLabel setting to 3 shouldn't the remaining items get the labels you desire? If this doesn't work with the standard Bar or GroupBar mode, then switch to Custom mode and make your pen types Bar on the pen details tab and the ticks per label should work. Using the ticks per label will allow the dataset to drive the display items, whereas CustomLabels are just hard-coded custom strings.

Regards,

Jeremy

Former Member
0 Likes

Thanks for your inputs Jeremy.

However, I am not been able to do that. XAxisTicksPerLabel is not having any effect on the output.

@Jeremy/Vijaya

Talking about Custum Labels, I guess for that the data will be hard-coded, however, my data is coming from the data source for x-axis labelling.

@Pradeep

The Label Depth is an alternative way for making labels look less clustured but consider the case when we are plotting three values against one x-axis column. In such cases, the same label gets repeated and which is just a shear waste of space.

Please correct me if i have misunderstood your comments.

jcgood25
Active Contributor
0 Likes

Have you tried Custom chart mode like I suggested earlier? You will need to specify Bar mode for each of your pens on the pen details tab, but this chart type should honor the corresponding XAxisTicksPerLabel setting.

Former Member
0 Likes

Hi Jeremy,

No, I havent tried that as yet. I will get back to you once I attempt that.

Thanks a lot for the support.