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

Labeling plot bands

7 Answers 151 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 16 Apr 2013, 08:42 PM
In this demo there is a plotBand at 30000, but it's pretty meaningless without a label. Is there a way to create a tooltip/label on it?
Thanks!

7 Answers, 1 is accepted

Sort by
0
Iliana Nikolova
Telerik team
answered on 17 Apr 2013, 11:12 AM
Hello Michael,

By design Chart's PlotBands does not have any tooltip / labels. If you wish you can submit this idea as a feature request at our UserVoice portal - this way the community would be able to evaluate it and if the suggestion gains popularity we will consider its implementation.
 
Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Sai Nadh
Top achievements
Rank 1
answered on 14 Mar 2017, 11:15 AM

Hello Nikolova,

Kindly let us know if solution is available for this query. 

In our project we need to show label for plotbands, because in case of multiple axis user is confused that for which axis it is plotted. 

thank you

0
Iliana Nikolova
Telerik team
answered on 16 Mar 2017, 08:24 AM
Hi Sai Nadh,

There is no a specific plotBands label option available in Kendo UI Chart, however you could draw text via the Drawing API. Take a look at the following examples which should give a basic idea: 

http://dojo.telerik.com/@Iliana/odAce (using the valueAxis.labels.visual option)
http://demos.telerik.com/kendo-ui/bar-charts/visuals
http://docs.telerik.com/kendo-ui/controls/charts/how-to/appearance/donut-chart-hole-text

Regards,
Iliana Nikolova
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Michel
Top achievements
Rank 1
answered on 30 Nov 2017, 09:28 AM

Hi,

Is it possible to get the rect geometry that the plotband is drawn into to place the text?

regards

0
Tsvetina
Telerik team
answered on 01 Dec 2017, 01:22 PM
Hello Thierry,

It isn't possible to get the plotband rect using the Chart APIs. However, you can draw a custom line/rectangle in the Chart on render, which could also have a Text element added. This help article shows such an example:
Render Custom Plot Bands

Regards,
Tsvetina
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
Michel
Top achievements
Rank 1
answered on 30 Nov 2018, 09:57 AM

Hi we followed the example you mentionned, and it worked well.

However a major limitation to this approach emerged as everything customly drawn is rendered on top of the graphical chart elements (series/points mainly), which results in clicks on points or series to be lost.

Is there a way to let the events go through the shapes drawn so the click events still get captured correctly by the underneath points?

regards

0
Tsvetina
Telerik team
answered on 30 Nov 2018, 04:20 PM
Hi Michael,

The custom drawn UI indeed captures the click event and prevents it from reaching the series. Unfortunately, there is no way to prevent this as the custom UI is added after the rest of the Chart is already drawn. Also, I cannot suggest a way to propagate the event to the series point lying beneath the custom plot band.

For this scenario, it is maybe better to go one step back where you were considering adding only custom text to already existing plot bands. You could try the following:
1. Use regular plot bands.
2. In the Chart render event, access the value axis and, using its slot() method, find the slot where the plot band is drawn using the to and from values of the plot band.
3. Using the coordinates of the returned slot, determine a position for your custom text and draw it in the Chart.

With this approach, series click will be prevented only if the user clicks on the text but not for the entire plot band:
http://dojo.telerik.com/@tsveti/UnumiSaq

Additionally, you could vote for the feature request for labels in the regular plot bands to help raise its priority:
Add labelling and tooltips to chart plot bands

Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Charts
Asked by
Michael
Top achievements
Rank 1
Answers by
Iliana Nikolova
Telerik team
Sai Nadh
Top achievements
Rank 1
Michel
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or