1
我在想方法,用戶可以點擊一個按鈕並導致Highcharts欄消失。如何使Highcharts酒吧消失?
例如,在我的Highcharts代碼在這裏:
$(function(){
Highcharts.setOptions({
colors:['#49acdd'],
chart:{
style: {
fontFamily:'Helvetica',
color:'#384044'
}
}
});
$("#chart").highcharts({
chart: {
type:'column',
backgroundColor:'#158479'
},
title: {
text: "Employer Organizations",
style: {
color: "#8A2BE2" //wmakes the text white
}
},
xAxis: {
tickWidth: 1,
labels: {
style: {
color: '#cc3737'
}
},
categories:[
'Educational and School-Based','Government Orgs','Charitable Foundation Orgs','Health-care Orgs','Market Research Orgs','Technology Firms','Human Service Orgs','Accounting/Finance Firms'
]
},
yAxis: {
gridLineWidth:0, //no gridlines
title: {
text:'',
style:{
color:'#fff'
}
},
labels: {
formatter:function(){
return Highcharts.numberFormat(this.value,0,'', ' ,');//returns ex: 1000 to 1,000
},
style:{
color:'#33FF00'
}
}
},//end of y axis
plotOptions:{
column: {
borderRadius: 4,
pointPadding:0,//paddin between each column or bar
groupPadding:0.1//Padding between each value groups, in x axis units
}
},
series: [{
name: "Employer Organizations",
data: [1,2,3,4,5,6,7,8]
}]
});
});
我知道了「plotOptions.bar.events.click」存在觸發基於點擊的功能,但我無法找到一個函數,當點擊時,讓一個Highchart欄消失。
你能有關它的更多的specifica?它是在一個網頁內,還是一個JS應用程序? –
如果你想刪除它..點擊該欄,獲取欄的數據ID和更新圖表的數據刪除選定的數據ID –
檢查此http://jsfiddle.net/mgpz9p32/可能幫幫我。點擊列刪除 –