score:2
Accepted answer
Instead of attacking the SVG directly with this.graphic.attr
, you'd be better off using the API to update the slice. Point.update works well for this:
legendItemClick: function () {
var series = this.series;
for (var i=0; i < series.data.length; i++){
var point = series.data[i];
if (point == this){
// set back to old color
point.update({color: series.chart.options.colors[this.id]});
}else{
// make it gray
point.update({color: '#CCCCCC'});
}
}
return false;
}
Updated fiddle here.
score:0
Well, I can get you 50% of the way there:
point: {
events: {
click: function () {
if (event.point.sliced) {
$.each(this.series.data, function (i, e) {
if (!e.sliced) {
this.graphic.attr({
fill: '#CCCCCC'
});
}
});
}
}
}
This still breaks when you re-click the slice to slot it back in - the colors of the other slices are still grey until you click on them. Will need to look more into this.
Source: stackoverflow.com
Related Query
- Set Colors of Different Points when Clicking on Pie Slice Legend
- set different colors for each column in highcharts
- How to disable legend click to stop pie slice from disappearing in Highcharts?
- Highcharts: add different colors to legend in one series histogram
- Can I assign a different radius for each pie slice using Highcharts?
- highcharts legend items align to the left when width is set
- Customise Highcharts Pie Chart Selection State so that slice does not animate out when selected
- How to color series legend in highcharts when colorbypoint is set to true
- Show tootip and select pie slice on legend click of pie chart in HighCharts
- Highcharts heatmap - disabling the legend results in different colors
- Highcharts: Change Pie Colors By Clicking on a button
- pie chart legend overlap with older legend when replace series in highchart
- how can we set different colors to highcharts-default-patterns?
- How can I set the legend symbol color for a series when using colorByPoint?
- How can I get inner slice when clicking on an outer slice in a HighChart donut chart?
- Set different colors for each column in DotNet.HighCharts
- How To Set Different Colors For Different Plots In A Same Chart?
- Highcharts pie wrong legend colors
- high charts - lost animation when pie chart sliced is programmatically set
- Highcharts pie chart legend items showing gradient colors
- Highcharts - Pie Chart change slice colors dynamically
- Using .hide() on pie series to hide a single slice like the legend event
- Highcharts how to make a set number of colors for pie chart data and drilldown data
- How to hide other series when clicking on legend on highcarts?
- Why does my Highchart look different when I transfer my code from Jsfiddle to my server?
- How to set color of each slice in pie chart in high charts library?
- Highcharts set slice size of pie chart
- Highcharts pie chart slice animation only works when an error is thrown
- How to set different colors for bars based on value in Highchart bar chart?
- How to set pie chart wedge colors based on wedge values for highcharts?
More Query from same tag
- Highcharts free-form drawing content not getting exported
- Pie chart taking more load time than line chart in highchart
- Disable legend hover in Highcharts
- Getting coordinates of chart on selecting plot in highcharts
- Highcharts - second y axis and plotlines in x and y directions
- Highchart.js drilldown adding to data dynamicaly without hardcoding.
- how to display 2 same highcharts without duplicate the code
- Hide one serie's dataLabel on Highcharts
- Explain Highcharts different Instantiations
- Center Highcharts tooltip in the middle of donut chart in a responsive way
- highchart Dynamically updated data
- How to include highcharts motion plugin for bubble plot using R wrapper?
- Show xrange x and x2 values in chart
- HighChart : plot line and plot click event
- Is it possible? xAxis categories with Json?
- Highchart map does not support IRS country code
- HighCharts Semi-Circle-Donut, remove margin and padding
- Highcharts pie legend clipped off
- Highcharts: Marker radius does not seem to work
- Highcharts redraw and sort data on draggable line graph
- Highcharts: scroll for text area inside highcharts container; custom table inside highcharts container
- HighChart Pie Chart click on legend item to trigger drilldown
- Highcharts - Getting chart on click event
- how do i remove the decimal point values from the array values?
- Highchart with background should be Dots instead of Grid
- Highcharts Gantt Vertical Scrollbar Missing in Full Screen Mode
- How can i make my gnatt highcharts tooltip in this shape
- Manipulate arrays into different formats
- Highcharts displaying decimals on yearly xAxis
- highcharts datetime point at fixed distance