这是截的Highchart官网的一张scatter 图,如果数据多,并且密集,legend放在图内就会影响数据的观看,这边需要设置
可以修改x,y使其在图内的位置改变(align,verticalAlign也可改变),但是不能将legend挪到图外面,
legend: {
layout: 'vertical', //layout:'horizontal', 横向排
align: 'left',
verticalAlign: 'top',
x: 450,
y: 50,
floating: true,
backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF',
borderWidth: 1
},
这边需要在chart下面增加marginLeft,marginRight,marginBottom,marginTop属性,这样配合x,y才能将其移到图外
chart: {
type: 'scatter',
marginLeft: 250,
zoomType: 'xy'
},
chart type:‘scatter’,zoomType:‘xy’-->可配置图表放大,通过拖动鼠标进行缩放,‘x’,‘y’,‘xy’。
将鼠标移到图中某一点时,一系列点被highlight出来,其它系列的点会半隐藏,如果变化较快感觉眼花,这边忽略这一变化设置如下:
plotOptions: {
states: {
inactive:{
opacity: 1
}
}