监听滑块滑动或滑块随鼠标移动 | JShare
fork from "Column with rotated labels"
var data = [29,12,32,28,22,34,9,12,13,21,24,32,27,31,32,16,21,18,20];
drawAdvChart();
function drawAdvChart() {
var option = {
chart : {
type : 'column',
renderTo : "container",
backgroundColor : '#FFFFFF',
plotBackgroundColor : '#FFFFFF',
panning : false,
//zoomType: 'xy',
margin : [11, 1, 1, 1], //离 top, Right, Bottom, left的距离
},
title : {
text : null
},
scrollbar : {
enabled : true,
barBackgroundColor : '#abc000',
barBorderRadius : 8,
barBorderWidth : 1,
buttonBorderWidth : 0,
buttonArrowColor : '#ffffff',
buttonBorderRadius : 10,
rifleColor : '#d2f1eb',
trackBackgroundColor : '#ffffff',
trackBorderWidth : 1,
trackBorderRadius : 8,
height: 16
},
tooltip : {
enabled : true,
shadow : false, //显示提示框阴影
borderWidth : 0,
backgroundColor : null,
crosshairs : [{
width : 1,
color : '#000000'
}]
},
xAxis : {
events : {
afterSetExtremes: function(e) {
var extremes = chart.xAxis[0].getExtremes();
var index = Math.ceil((extremes.min + 2));
//alert(index);
this.series[0].data[index].select();
//this.series[0].data[index].hover;
chart.tooltip.refresh(this.series[0].data[index]);
//chart.hoverPoint(this.series[0].data[index]);
//chart.series[0].data[index].point.mouseOver();
}
},
labels : {//标签轴设置
enabled : false, //关闭x轴显示
},
tickLength : 0, //x刻度线长宽
min : 0,
max : 8,
},
yAxis : {
title : {
text : ''
},
labels : {
enabled : false, //关闭y轴显示
},
gridLineColor : '#d8f2ee', //y轴网格颜色
tickAmount : 4
},
series : [{
color : '#FF0F00',
data : [],
point : {
events : {
mouseOver : function() {
},
click : function() {
},
mouseOut : function() {
}
}
},
}],
plotOptions : {
series:{
stickyTracking: true,
states: {
hover: {
brightness: -0.3 // darken
}
}
}
},
legend : {
enabled : false //隐藏图例说明
},
credits : {
enabled : false //去除版权信息
}
};
option.series[0].data = data;
var chart = new Highcharts.Chart(option);
}
{"resource":"1,4","options":null,"code":{"code":"hhhGzL","name":"监听滑块滑动或滑块随鼠标移动","version":0,"doctype":0,"description":"fork from \"Column with rotated labels\"","meta":null,"newGroup":240,"group":{"id":240,"name":"默认分组","code":"shushu"}}}