We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Query: Set number of displayed legend entries in a Chart

Hi We're having issues with the number of displayed x axis legend entries. What we are trying to get it a consistent number of evenly spaced x axis labels for multiple different charts (enough data points to produce them).

As an example in the playground if I set maximumLabels to 2, we get an inconsistent number of legend entries.

http://jsplayground.syncfusion.com/c0qdxchs

Is there a way of setting total number of legend entries for a chart?
If not can we make that feature request?




1 Reply

DP Deepaa Pragaasam Syncfusion Team November 9, 2015 12:25 PM UTC

Hi Robert,

 Thanks for contacting Syncfusion Support.

  We have analysed your query.

The MaximumLabels property determines the number of labels displayed per 100 pixels when the range is not set.

To know more about the maximum labels property please refer the below link
https://help.syncfusion.com/js/chart/axis#maximum-number-of-labels-per-100-pixels


If the Range is set, then all the data within the particular range is displayed.

Please refer the below link to know more about the range in datetime axis

https://help.syncfusion.com/js/chart/axis#customizing-date-time-range

If all the labels need to be displayed then the label intersect action can be set as Multiple Rows

https://help.syncfusion.com/api/js/ejchart#members:primaryxaxis-labelintersectaction


To know more about the label intersect action please refer the below sample:

https://js.syncfusion.com/demos/jquery/#!/azure/chart/chartaxes/smartaxislabels


When the label Format for the xAxis labels is changed then more labels will be visible

We have modified the sample containing the label intersect action property.

JSPlaygroundSampleLink : https://jsplayground.syncfusion.com/hkch4g11




We would also like to know if the highlighted part is what you have specified as legends.

If not kindly revert back us to specifying your requirement

Please let us know if you have any concerns

Regards,

Deepaa.


Loader.
Up arrow icon