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

Dynamic chart element explode

3 Answers 96 Views
Charts
This is a migrated thread and some comments may be shown as answers.
A
Top achievements
Rank 1
A asked on 08 Oct 2012, 01:43 PM
Hi,
How can I make kendo donut chart element dynamically explode on mouse  hover?

3 Answers, 1 is accepted

Sort by
0
Nohinn
Top achievements
Rank 1
answered on 08 Oct 2012, 02:14 PM
Here you have an example:
http://jsbin.com/evasab/1/edit 

Of course if you're fetching the data from a service or something I would recommend you storing it locally in a var so every time you initialize the chart you don't have the delay of getting the data.
0
A
Top achievements
Rank 1
answered on 09 Oct 2012, 07:43 AM
Thanks a lot.It's worked,but however tool tip escaped.How make it visible when  chart element is exploding? 
0
A
Top achievements
Rank 1
answered on 09 Oct 2012, 07:58 AM
Ok,I solved it.
Here's the edited code:
var previousItem;
function applyExplode(dataItem, chartItem) {
    if ((undefined == previousItem) || (dataItem.category != previousItem.category)) {
        var index;
        for (index = 0; index < chartItem.series[0].data.length; index++) {
            var item = chartItem.series[0].data[index];
            if (item.category == dataItem.category && item.value == dataItem.value) {
                break;
            }
        }
        $("#chartKendo").removeData();
        $("#chartKendo").empty();
        var newData = $.extend(true, {}, chartItem);
        newData.series[0].data[index].explode = true;
        newData.transitions = false;
        $("#chartKendo").kendoChart(newData);
    }
    previousItem = dataItem;
}
Tags
Charts
Asked by
A
Top achievements
Rank 1
Answers by
Nohinn
Top achievements
Rank 1
A
Top achievements
Rank 1
Share this question
or