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

Kendo-chart-series label on horizontal bar chart

2 Answers 852 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chau
Top achievements
Rank 1
Chau asked on 27 Jun 2018, 02:27 AM

Could you tell me how to style the label to not overlay with the negative value on a horizontal bar chart?

(see chart image attached)

Thank you.

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Topalov
Telerik team
answered on 28 Jun 2018, 10:54 AM
Hi Chau,

If I understand correctly, you would like the vertical axis's labels to not overlap with the series bars. To achieve this, you can define two vertical axes (one of visible labels, one with hidden labels) and let the one with the visible labels intersect with the horizontal axis at its leftmost point, while the one that has no visible labels can intersect with the horizontal axes at point 0, e.g.:

https://plnkr.co/edit/7wiyFIscn40tYvflE8dh?p=preview

You can control the crossing points via the axisCrossingValue property of the value axis (in this example - the horizontal one). The labels, majorTicks and other category axis options are available in the respective CategoryAxisItem API:

https://www.telerik.com/kendo-angular-ui/components/charts/api/CategoryAxisItemComponent/

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
Chau
Top achievements
Rank 1
answered on 28 Jun 2018, 10:13 PM

Thanks Dimiter for your prompt reply!

I used your advice of having two chart-axis (one with visible labels and one with hidden labels at point 0), and setting a majorTicks value to allow some space between the seriesLabel value and the axis label.  

Tags
General Discussions
Asked by
Chau
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Chau
Top achievements
Rank 1
Share this question
or