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

Checked List of CategoryAxis items

2 Answers 76 Views
Charts
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 02 Feb 2015, 09:35 PM
I have a requirement to have a multi-series column chart with the series legend on the top AND have the list of categoryAxis items in a "legend" on the right (in the location where a right series legend would be) - the categoryAxis items in the right "legend" area will be checkboxes and the user can check/uncheck a categoryAxis item and have it show/hide in the chart dynamically.

Given the chart here, the addition would be having the categoryAxis items (2002, 2003, etc) as a list of checkboxes off to the right of the chart (initially all checked). When you uncheck an item, that categoryAxis item would disappear from the chart; when you check an item, it would appear in the chart. Unless specific logic was put in place, I guess you would be able to hide all categoryAxis items

So, I have a couple questions:

1. Can categoryAxis items be hidden/shown dynamically and have the rest of the data "fill the space" (so there wouldn't be a "gap" where the hidden categoryAxis used to be?) without having to refresh the dataSource?
2. How do you recommend approaching the checkbox list of categoryAxis items?

Thanks,
John

2 Answers, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
answered on 03 Feb 2015, 10:20 PM
So, I'm working out the approach for #2 above - just putting a float div to the right of my chart div. That float div contains the list of checkboxes which I got from the dataBound event and e.sender.dataSource.data().

I'm still trying to figure out #1 above - now that I've got my checkboxes and I'm subscribing to the click events, how can I show/hide the x axis item in the chart?

Thanks,
John
0
Iliana Dyankova
Telerik team
answered on 04 Feb 2015, 11:58 AM
Hi John,

Hiding / showing categoryAxis labels is not supported by Kendo UI Chart. As a possible workaround I would suggest the following:
- Bind the chart to a dataSource;
- Use the dataSouce API to add / remove items.
Note that when bound to a dataSource the chart will automatically refresh when this dataSource is changed.

Regards,
Iliana Nikolova
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
John
Top achievements
Rank 1
Answers by
John
Top achievements
Rank 1
Iliana Dyankova
Telerik team
Share this question
or