This is a migrated thread and some comments may be shown as answers.

specifying where chart value axis draws labels

5 Answers 283 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Drew
Top achievements
Rank 1
Drew asked on 15 Jun 2018, 03:32 PM
Is there a way to configure a ScatterLine chart's x-axis so that the series goes edge-to-edge, while also ensuring that specific x-axis values get a label?

The chart I am drawing has starting and ending x-values that are not conveniently integer divisible by the major unit value for my chart. If I do not specify the axis min or max, I get a chart that looks like the first attachment. If I set the axis min/max, I get a chart that looks like the second attachment. What I would like is a combination of the two, with the labels including one at 0 like the first chart, with other labels extending outwards from there at major unit intervals. With the example of major unit 0.05, the labels on the second attachment should be [-0.15, -0.1, -0.05, 0, 0.05, 0.1]. Is this possible?

5 Answers, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 19 Jun 2018, 01:29 PM
Hello Drew,

The desired combination is not supported out-of-the-box as this would mean detaching the logic for drawing the labels from the actual values for the respective axis which is not possible.
 
The starting point when min/max is used is always the value, provided to the "min" property and every other label is derived from adding the predefined major unit to the first point's value.

There are couple of workarounds that might yield the desired behavior:

1) Use the content property of the xAxis labels option to provide the desired values for each label, e.g.:

https://plnkr.co/edit/tqsOyoHF4xJRkT3y9Ihb?p=preview (the far more straight-forward approach)

2) Provide a custom visual for each label (seems like an overkill for this situation)

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Drew
Top achievements
Rank 1
answered on 20 Jun 2018, 09:50 PM
Neither of those options works for my use case. The data value for the first point is not guaranteed to fall near enough to an integer multiple of the major unit to make rounding viable. It can result in some weird effects, like a negative x-value appearing to the right of 0: https://plnkr.co/edit/KOfKTa9TwHkJL84Y95Xu?p=preview

This is an odd gap in the capabilities of Kendo Charts, considering the extent of customization available.
0
Dimiter Topalov
Telerik team
answered on 22 Jun 2018, 11:31 AM
Hello Drew,

Indeed, the suggested approach is not ideal for all cases, just a possible approach to display custom values in the labels. Currently it is not possible to have different values and labels and both to be correct - either the labels and vertical lines will be at positions in accordance with the data, or discrepancy like the one you pointed out could be observed.

If you have the time, please submit a feature request for any functionality or behavior that is currently not available out-of-the-box to our UserVoice portal, describing the desired functionality and the motivation behind:

http://kendoui-feedback.telerik.com/forums/555517-kendo-ui-for-angular-feedback?category_id=181396

This helps us estimate the customer demand for certain features and enhancements, and prioritize accordingly when updating our roadmap. Thank you in advance.

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Drew
Top achievements
Rank 1
answered on 22 Jun 2018, 04:38 PM
Thanks Dimiter, I made a feature request.

http://kendoui-feedback.telerik.com/forums/555517-kendo-ui-for-angular-feedback/suggestions/34636567-add-option-to-specify-the-axis-values-to-label-for
0
Dimiter Topalov
Telerik team
answered on 26 Jun 2018, 06:09 AM
Hi Drew,

Thank you very much. We will track the UserVoice portal and make sure to address all popular items.

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Drew
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Drew
Top achievements
Rank 1
Share this question
or