Klakurka

Possible to force last data point labels?

Recommended Posts

Hi there,

In the example below, the data runs to 2017-12-23 but the last label (on the right) says 2017-11-25. This confuses our users as these charts update weekly and sometimes they will think that the data is not recent when it is.

Is there a way to force the first and last data point labels to ensure that it's known when the start and end dates are just by looking at the labels?

image.png.4c4f885fc62190a28679f141f76f2c98.png

Thanks!

Share this post


Link to post
Share on other sites

I had heard that setting canvaspadding to 0 will do it but it only works for the first label, and the last label is never shown (just barely).

 

Example w/ slightly different data but using 'canvaspadding' => 0:

image.png.bd3ede2dd2adfa373ff9603517aecd60.png

Share this post


Link to post
Share on other sites

Hi,

Please note since the number of plots are huge hence FusionCharts automatically shows labels so as to provide a good visualization, hence if you want to show all the labels of the data plots please set labelDisplay as NONE but please note this will make the labels overlap since you are forcefully disabling the label customization and skipping.

From the above requirement since you are updating the column charts data on a weekly basis, and you want to show the x-axis limits you could set showLables to 0 at the chart level and inside the data level please set showLabel to 1 only for the first and the last data plot in order to show them as limits.

Please check this sample fiddle for reference - http://jsfiddle.net/fmw79ajt/

Share this post


Link to post
Share on other sites

Hey Ayan,

Thanks for the reply.

Yes, that is one possible solution. I will give that a try.

But no, I don't need to show all labels of course. The only suggestion I have would be to improve the show/hide label algorithm to always show the first and last labels and fill in the rest as is possible as this would make for a much better default I think. I don't see any downside to this as it's currently random based on chart width and # of data points.

[edit] The method you describe would effectively involve us writing the algorithm that we'd like to see as the default, just FYI.

Edited by Klakurka

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