【发布时间】:2015-12-09 10:48:30
【问题描述】:
当用户选择特定列时,我无法弄清楚如何淡出所有其他列。我尝试制作一个循环来遍历数据,但它仍然不起作用。
另外,我需要一旦用户单击一列然后再次单击它,所有列都会再次淡入。
此代码目前仅突出显示一个条形。
有什么建议吗?
$(function() {
$('#container4').highcharts({
chart: {
type: 'column'
},
title: {
text: ''
},
legend: {
enabled: false
},
exporting: {
enabled: false
},
credits: {
enabled: false
},
xAxis: {
gridLineColor: '',
labels: {
enabled: false
}
},
yAxis: {
title: {
text: 'Fruit'
},
visible: false
},
credits: {
enabled: false
},
plotOptions: {
series: {
allowPointSelect: true,
states: {
select: {
color: 'blue',
}
}
},
column: {
stacking: 'normal',
}
},
series: [{
name: '',
data: [-40, -60, -70, -80, -90, -100, -100, -100, -100, -100, -100],
threshold: 0,
color: '#E0E0E0 ',
enableMouseTracking: false,
}, {
name: '',
data: [-60, -40, -30, -20, -10, 0, 10, 20, 30, 40, 50],
threshold: 0,
color: 'green',
negativeColor: 'red',
}, ]
});
});
【问题讨论】:
-
您使用的是 Angular 还是 jQuery?把两者混在一起是很矛盾的。有一个Angular plugin for Highcharts...
-
你可以遍历所有点并使用
point.graphic.attr({ opacity: 0.1 });- 你试过了吗?
标签: jquery html angularjs svg highcharts