Sign in to follow this  
Sanjukta

Limiting number of X-Axis Labels

Recommended Posts

I am familiar with the labelStep attribute and how it can be used to limit how many labels are displayed on the X-Axis. Is there any setting which will calculate this value so that labels can be display nicely along the X-Axis? Or does it have to be explicitly set?

 

 

 

I am developing an application where the end user can specify a time frame (e.g. 7 days, last 30 days) and the formatting (e.g. mm/dd; mm/dd/yyyy). These ultimately determine the X-Axis labels. Is there any "auto-format" option? Or would I have to calculate this myself and set?

 

 

 

Thanks.

Share this post


Link to post
Share on other sites

Hi,

Please find the solution for your issues below:

Q:

I am familiar with the labelStep attribute and how it can be used to limit how many labels are displayed on the X-Axis. Is there any setting which will calculate this value so that labels can be display nicely along the X-Axis? Or does it have to be explicitly set?

A: In FusionCharts by default, all the labels are displayed on the chart.However, if you've a set of streaming data (like name of months or days of week), you can opt to hide every n-th label for better clarity.

 

This attributes just allows to skip every n(th) X-axis label.

 

But the value for the attribute labelStep needs to be explicitly given by the user in the <chart> element according to the requirement of the number of labels to be skipped.

Q:

I am developing an application where the end user can specify a time frame (e.g. 7 days, last 30 days) and the formatting (e.g. mm/dd; mm/dd/yyyy). These ultimately determine the X-Axis labels. Is there any "auto-format" option? Or would I have to calculate this myself and set?

A: I am afraid, FusionCharts does not support the date and time format as data values, as of now. In case, you wish to display in the date and time format, you need to mention it as string value (manually) in the data labels.

FusionCharts only accepts numbers as X-axis values but as of now natively do not provide any method to convert the date and time into integer. But every scripting language provides a specific method using which you can get a integer equivalence of a date. Please try and look for the specific function that nedds to be invoked into your code for the necessary conversion. Additionally you can provide a string display value for each X-axis category which can be the string representation of the date.

I hope this helps. Please do share your feedback with us on this thread.

Share this post


Link to post
Share on other sites

Thank you for the response. Actually I am able to control the formatting of the dates using my server scripting language. This is not the problem. I was asking whether there was some "Auto-Space" property. In essence this would calculate the labelstep automatically such that labels would never overwrite each other (and render a nice readable chart).

 

 

 

Based on your response there is no such setting; it must be controlled in the XML by specifying the labelstep property.

Share this post


Link to post
Share on other sites

Hi,

You are welcome. :)

I was asking whether there was some "Auto-Space" property. In essence this would calculate the labelstep automatically such that labels would never overwrite each other (and render a nice readable chart). Based on your response there is no such setting; it must be controlled in the XML by specifying the labelstep property.

 

I am afraid, FusionCharts does not support "auto-spacing" functionality, as of now. :)

The value for the attribute "labelStep" in the <chart> element needs to be mentioned (manually) in the XML.

Above all, your suggestions are very important to us. We made a note of the same.

Happy FusionCharting! :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this