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

Partial legend for grouped and stacked bar chart

3 Answers 216 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Olli
Top achievements
Rank 1
Olli asked on 06 Aug 2013, 07:37 AM
I've got chart that is basically like this: http://jsfiddle.net/huHVd/ (slightly modified from the Kendo examples).

I'm looking for chart legend that would be created only partially so that every legend item would be shown once (not twice as it is in the exmaple chart).

Any comments on that?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Hristo Germanov
Telerik team
answered on 06 Aug 2013, 02:18 PM
Hello Olli,

This functionality is not available by the Chart and I can't offer you a workaround. Please excuse us for the inconvenience that this may cause. 

Regards,
Hristo Germanov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Olli
Top achievements
Rank 1
answered on 12 Aug 2013, 05:59 AM
Short answer to my own question in case if someone other has similar problem: I got it working by manually modifying (with JavaScript) generated SVG in html. In my case I look for the last <g> element in the SVG document, read the legend items (x and y coordinates, names and colors of the boxes) and remove all of them. After that I create new ones without duplicates and add the new elements to the <g> element. Looking the genereted SVG should give you example of what kind of elements you should create for the SVG.

Couldn't figure any better solution than this out. Maybe not the most efficient way to first generate SVG, and then replace it with another, but it works :)

Olli
0
Hristo Germanov
Telerik team
answered on 13 Aug 2013, 09:03 AM
Hello Olli,

I missed something in a previous post and I apologize for that.

We have a visibleInLegend property that will fit in your case. You need to set it to false in this series that you don't want to show in the legend. I have updated your test sample: http://jsfiddle.net/huHVd/3/

Regards,
Hristo Germanov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Charts
Asked by
Olli
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Olli
Top achievements
Rank 1
Share this question
or