1. 让图形能够居中,进行缩放,达到了效果(x轴、y轴都进行了缩放),现在需要y轴不能缩放
2. 滚轮缩放,是对鼠标在屏幕的位置进行放大,这样会导致一些图形会消失,这是因为filterMode默认为filter
配置项如下
option = {
"title": {
"show": false,
"text": "",
"left": 0
},
"tooltip": {
"trigger": "none",
"axisPointer": {
"type": "cross"
}
},
"axisPointer": {
"label": {
"backgroundColor": "#cccccc",
"textStyle": {
"color": "#333333",
"fontSize": 12
}
},
"link": {
"xAxisIndex": "all"
}
},
"grid": [{
"left": "5%",
"right": "35",
"bottom": "0%",
"top": "5%",
"height": "60%"
}, {
"left": "5%",
"right": "35",
"top": "65%",
"bottom": "0",
"height": "10%"
}],
"xAxis": [{
"type": "category",
"gridIndex": 0,
"data": ["12-09-2016", "12-12-2016", "12-13-2016", "12-14-2016", "12-15-2016", "12-16-2016", "12-19-2016",
"12-20-2016", "12-21-2016", "12-22-2016", "12-23-2016", "12-27-2016", "12-28-2016", "12-29-2016",
"12-30-2016", "01-03-2017", "01-04-2017", "01-05-2017", "01-06-2017", "01-09-2017", "01-10-2017",
"01-11-2017", "01-12-2017", "01-13-2017", "01-17-2017", "01-18-2017", "01-19-2017", "01-20-2017",
"01-23-2017", "01-24-2017", "01-25-2017", "01-26-2017", "01-27-2017", "01-30-2017", "01-31-2017",
"02-01-2017", "02-02-2017", "02-03-2017", "02-06-2017", "02-07-2017", "02-08-2017", "02-09-2017",
"02-10-2017", "02-13-2017", "02-14-2017", "02-15-2017", "02-16-2017", "02-17-2017", "02-21-2017",
"02-22-2017", "02-23-2017", "02-24-2017", "02-27-2017", "02-28-2017", "03-01-2017", "03-02-2017",
"03-03-2017", "03-06-2017", "03-07-2017", "03-08-2017", "03-09-2017", "03-10-2017", "03-13-2017",
"03-14-2017", "03-15-2017", "03-16-2017", "03-17-2017", "03-20-2017", "03-21-2017", "03-22-2017",
"03-23-2017", "03-24-2017", "03-27-2017", "03-28-2017", "03-29-2017", "03-30-2017", "03-31-2017",
"04-03-2017", "04-04-2017", "04-05-2017", "04-06-2017", "04-07-2017", "04-10-2017", "04-11-2017",
"04-12-2017", "04-13-2017", "04-17-2017", "04-18-2017", "04-19-2017", "04-20-2017", "04-21-2017",
"04-24-2017", "04-25-2017", "04-26-2017", "04-27-2017", "04-28-2017", "05-01-2017", "05-02-2017",
"05-03-2017", "05-04-2017", "05-05-2017", "05-08-2017", "05-09-2017", "05-10-2017", "05-11-2017",
"05-12-2017", "05-15-2017", "05-16-2017", "05-17-2017", "05-18-2017", "05-19-2017", "05-22-2017",
"05-23-2017", "05-24-2017", "05-25-2017", "05-26-2017", "05-30-2017", "05-31-2017", "06-01-2017",
"06-02-2017", "06-05-2017", "06-06-2017", "06-07-2017", "06-08-2017", "06-09-2017", "06-12-2017",
"06-13-2017", "06-14-2017", "06-15-2017", "06-16-2017", "06-19-2017", "06-20-2017", "06-21-2017",
"06-22-2017", "06-23-2017", "06-26-2017", "06-27-2017"
],
"scale": true,
"boundaryGap": true,
"axisLine": {
"show": false
},
"axisTick": {
"show": false
},
"splitLine": {
"show": false
},
"axisLabel": {
"show": false
},
"min": "dataMin",
"max": "dataMax",
"axisPointer": {
"z": 100
}
}, {
"type": "category",
"gridIndex": 1,
"data": ["12-09-2016", "12-12-2016", "12-13-2016", "12-14-2016", "12-15-2016", "12-16-2016", "12-19-2016",
"12-20-2016", "12-21-2016", "12-22-2016", "12-23-2016", "12-27-2016", "12-28-2016", "12-29-2016",
"12-30-2016", "01-03-2017", "01-04-2017", "01-05-2017", "01-06-2017", "01-09-2017", "01-10-2017",
"01-11-2017", "01-12-2017", "01-13-2017", "01-17-2017", "01-18-2017", "01-19-2017", "01-20-2017",
"01-23-2017", "01-24-2017", "01-25-2017", "01-26-2017", "01-27-2017", "01-30-2017", "01-31-2017",
"02-01-2017", "02-02-2017", "02-03-2017", "02-06-2017", "02-07-2017", "02-08-2017", "02-09-2017",
"02-10-2017", "02-13-2017", "02-14-2017", "02-15-2017", "02-16-2017", "02-17-2017", "02-21-2017",
"02-22-2017", "02-23-2017", "02-24-2017", "02-27-2017", "02-28-2017", "03-01-2017", "03-02-2017",
"03-03-2017", "03-06-2017", "03-07-2017", "03-08-2017", "03-09-2017", "03-10-2017", "03-13-2017",
"03-14-2017", "03-15-2017", "03-16-2017", "03-17-2017", "03-20-2017", "03-21-2017", "03-22-2017",
"03-23-2017", "03-24-2017", "03-27-2017", "03-28-2017", "03-29-2017", "03-30-2017", "03-31-2017",
"04-03-2017", "04-04-2017", "04-05-2017", "04-06-2017", "04-07-2017", "04-10-2017", "04-11-2017",
"04-12-2017", "04-13-2017", "04-17-2017", "04-18-2017", "04-19-2017", "04-20-2017", "04-21-2017",
"04-24-2017", "04-25-2017", "04-26-2017", "04-27-2017", "04-28-2017", "05-01-2017", "05-02-2017",
"05-03-2017", "05-04-2017", "05-05-2017", "05-08-2017", "05-09-2017", "05-10-2017", "05-11-2017",
"05-12-2017", "05-15-2017", "05-16-2017", "05-17-2017", "05-18-2017", "05-19-2017", "05-22-2017",
"05-23-2017", "05-24-2017", "05-25-2017", "05-26-2017", "05-30-2017", "05-31-2017", "06-01-2017",
"06-02-2017", "06-05-2017", "06-06-2017", "06-07-2017", "06-08-2017", "06-09-2017", "06-12-2017",
"06-13-2017", "06-14-2017", "06-15-2017", "06-16-2017", "06-19-2017", "06-20-2017", "06-21-2017",
"06-22-2017", "06-23-2017", "06-26-2017", "06-27-2017"
],
"scale": true,
"boundaryGap": true,
"axisLine": {
"onZero": false,
"lineStyle": {
"color": "#dddddd"
}
},
"splitLine": {
"show": false,
"lineStyle": {
"color": "#eeeeee"
}
},
"splitNumber": 20,
"axisLabel": {
"textStyle": {
"color": "#999",
"fontSize": 10
}
},
"min": "dataMin",
"max": "dataMax",
"axisPointer": {
"label": {}
}
}],
"yAxis": [{
"scale": true,
"gridIndex": 0,
"splitArea": {
"show": false
},
"axisLabel": {
"textStyle": {
"color": "#999",
"fontSize": 10
}
},
"axisLine": {
"lineStyle": {
"color": "#dddddd"
}
},
"position": "right",
"max": 150,
"min": 120
}, {
"scale": true,
"gridIndex": 1,
"axisLabel": {
"show": false,
"textStyle": {
"color": "#999",
"fontSize": 10
}
},
"axisLine": {
"show": false,
"lineStyle": {
"color": "#dddddd"
}
},
"axisTick": {
"show": false
},
"splitLine": {
"show": false
},
"position": "right",
"max": 3779970,
"min": 247692,
"interval": 3532278
}],
"dataZoom": [{
"type": "inside",
"xAxisIndex": [0, 1],
"startValue": 87,
"endValue": 131,
"zoomLock": false
}],
"series": [{
"name": "日K",
"type": "candlestick",
"data": [
[142.65, 142.54, 141.6001, 143.155],
[142.34, 141.22, 140.28, 142.89],
[141.9, 142.36, 140.66, 143.085],
[144.94, 144.08, 143.69, 147.25],
[144.65, 145.54, 143.43, 146.64],
[144.93, 144.64, 143.76, 145.38],
[144.73, 145.15, 144.32, 145.57],
[145.81, 146.56, 145.74, 147.23],
[146.66, 146.11, 145.76, 148.34],
[146.34, 144.24, 143.911, 147.74],
[144.39, 145.45, 144.003, 145.56],
[145.64, 145.33, 144.759, 146.88],
[145.18, 144.06, 143.95, 145.96],
[144.39, 144.92, 144.02, 145.88],
[144.96, 144.72, 144.09, 145.4999],
[145.65, 144.8, 143.76, 145.87],
[144.91, 145.46, 144.29, 146.72],
[145.13, 144.42, 143.92, 146.98],
[144.29, 144.45, 143.88, 145.37],
[144.01, 144.15, 142.07, 144.29],
[144.63, 144.24, 143.98, 145],
[144, 144.03, 143.5, 144.99],
[143.82, 142.99, 141.8, 144.67],
[143.56, 143.37, 142.74, 144.68],
[142.87, 141.63, 140.75, 143.5],
[141.5, 142.84, 141.45, 143.23],
[143.17, 142.54, 141.925, 144.1934],
[142.97, 142.1, 141.88, 143.39],
[142.08,
141.14, 140.275, 142.85
],
[141.54, 144.15, 141.28, 144.61],
[144.96, 145.75, 143.27, 145.89],
[
139.3, 133.72, 132.58, 139.87
],
[133.28, 135.54, 133.28, 138.27],
[135.06, 134.69, 133.75, 135.58],
[
132.6, 134.03, 132.51, 135.49
],
[134.07, 132.34, 131.54, 134.09],
[130.8, 134.45, 130.61, 134.79],
[
134.4, 136.23, 134.4, 136.52
],
[135.54, 136.68, 135.01, 136.99],
[137, 138.57, 136.78, 138.59],
[
138.13, 138.88, 137.86, 139.49
],
[139.14, 139.73, 139.14, 140.69],
[140, 139.69, 139.01, 140.25],
[
140.09, 140.47, 139.45, 141.88
],
[140.43, 141.1, 140.18, 141.22],
[141.3, 143.13, 140.685, 143.57],
[
143.34, 143.24, 141.66, 143.785
],
[142.87, 143.35, 141.93, 143.63],
[143.31, 145.05, 142.3, 145.55],
[144.66, 144.84, 143.91, 145.38],
[144.94, 144.2, 143.235, 145.05],
[143.73, 144.41, 143.19,
144.58
],
[144.46, 143.61, 143.09, 144.665],
[143.27, 143.27, 142.33, 143.67],
[144.01, 145.08,
143.31, 145.982
],
[144.79, 142.1, 142.04, 144.79],
[142.5, 142.87, 140.4, 143.065],
[142.66,
141.34, 141.28, 142.66
],
[141.09, 143.6, 140.5, 143.93],
[143.46, 142.88, 142.24, 143.77],
[143.11, 143.76, 142.12, 144.1],
[144.58, 145.93, 144, 145.98],
[146, 146.29, 144.71, 146.99],
[145.56, 145.13, 144.2, 145.73],
[145.73, 146.48, 144.75, 147.02],
[146.4, 147.82, 145.96, 148],
[
147.91, 148.79, 147.38, 149.11
],
[148.66, 148.75, 147.74, 149.5],
[149.32, 145.77, 145.57, 149.44],
[
145.94, 145.69, 145.026, 146.6
],
[145.48, 146.55, 145.05, 148.1995],
[146.96, 146.57, 145.57,
148.19
],
[145.64, 146.52, 144.16, 147.09],
[146.5, 147.13, 145, 147.54],
[141.19, 142.1, 140.63,
143.5
],
[141.72, 142.48, 141.556, 142.9],
[142.66, 142.57, 141.94, 143.05],
[142.73, 141.02,
139.86, 142.92
],
[140.98, 139.43, 139.12, 141.57],
[139.89, 138.09, 137.76, 141.15],
[138.3,
138.3, 137.19, 139.15
],
[137.9, 137.03, 136.97, 138.055],
[137.37, 136.86, 136.28, 137.84],
[
136.88, 136.68, 135.7, 137.25
],
[137.24, 134.88, 134.73, 137.28],
[135.07, 134.43, 134.3, 136.41],
[
134.98, 135.98, 134.43, 136.35
],
[135.79, 135.43, 135.085, 136.34],
[135.61, 135.93, 135.58,
136.73
],
[136.62, 136.87, 136.03, 137.21],
[136.79, 136.54, 136.13, 137.1],
[137.92, 137.93,
136.93, 138.54
],
[137.52, 138.19, 137.51, 139.34],
[138.68, 137.3, 137.3, 139.09],
[126.01, 126.99, 125.3, 130.05],
[126.96, 129.13, 126.68, 129.68],
[128.91, 127.4, 127.11, 130.3],
[126.15,
127.5, 125.6, 127.68
],
[126.67, 126.99, 126.29, 127.79],
[127.12, 126.42, 125.97, 127.7],
[126.99,
128.57, 126.63, 128.72
],
[128.58, 129.76, 128.09, 129.84],
[129.98, 130.84, 129.52, 131.49],
[
130.59, 131.6, 129.46, 131.67
],
[131.14, 129.94, 129.64, 131.48],
[129.63, 129.16, 129.08, 130.25],
[
129.64, 131.72, 129.38, 131.78
],
[131.46, 131.38, 130.23, 131.93],
[129.9, 127.87, 127.71, 130.62],
[
126.89, 125.9, 124.27, 128.02
],
[126.44, 127.15, 126.385, 127.51],
[127.54, 128.55, 127.25, 129.22],
[128.61, 125.99, 124.94, 128.81],
[126.27, 126.85, 125.5301, 126.92],
[127, 127.58, 126.42,
127.8548
],
[127.4, 127.16, 126.4, 127.4],
[127.02, 128, 126.82, 129.08],
[128.56, 128.13, 126.48,
129
],
[128.85, 130.09, 128.58, 130.09],
[129.84, 129.31, 129.06, 130.39],
[129.01, 129.66, 128.82,
130.34
],
[129.35, 129.52, 128.8, 129.935],
[129.44, 127.97, 126.92, 129.9],
[128.24, 130.83,
127.7, 130.99
],
[130.97, 129.3, 128.09, 131.69],
[128.19, 128.68, 126.98, 128.94],
[128.58, 130.14, 128.58, 130.52],
[130.74, 129.78, 129.03, 132.2],
[129.13, 129.35, 128.43, 130.36],
[129.76,
129.19, 128, 130.19
],
[129.84, 130.63, 129.59, 131.07],
[130.73, 128.85, 128.73, 131.21],
[129.29,
128.99, 128.53, 129.94
],
[129.19, 128.95, 127.94, 129.34],
[129.61, 129.99, 129.1, 130.65],
[
130.4, 129.04, 128.86, 130.49
],
[128.69, 127.8, 127.74, 129.47]
],
"itemStyle": {
"normal": {
"color": "#00ab00",
"color0": "#e93030",
"borderColor": "#00ab00",
"borderColor0": "#e93030"
}
},
"markArea": {
"silent": true,
"itemStyle": {
"normal": {
"color": "#f2dbdb",
"borderWidth": 1,
"borderType": "dashed",
"borderColor": "#f2dbdb"
}
},
"data": []
},
"markLine": {
"symbol": ["none", "none"],
"lineStyle": {
"normal": {
"color": "#da9be8",
"width": 2
},
"emphasis": {
"color": "#da9be8",
"width": 2
}
},
"data": [
[{
"coord": [92, 133.85500000000002],
"lineStyle": {
"normal": {
"type": "dotted"
}
},
"name": ""
}, {
"coord": [131, 128.8131493631802],
"lineStyle": {
"normal": {
"type": "dotted"
}
}
}],
[{
"coord": [92, 120.80461538461536],
"lineStyle": {
"normal": {
"type": "dotted"
}
},
"name": ""
}, {
"coord": [131, 128.8131493631802],
"lineStyle": {
"normal": {
"type": "dotted"
}
}
}],
[{
"coord": [94, 125.3],
"lineStyle": {
"normal": {
"type": "solid"
}
},
"name": ""
}, {
"coord": [107, 131.93],
"lineStyle": {
"normal": {
"type": "solid"
}
}
}],
[{
"coord": [107, 131.93],
"lineStyle": {
"normal": {
"type": "solid"
}
},
"name": ""
}, {
"coord": [109, 124.27],
"lineStyle": {
"normal": {
"type": "solid"
}
}
}],
[{
"coord": [109, 124.27],
"lineStyle": {
"normal": {
"type": "solid"
}
},
"name": ""
}, {
"coord": [119, 130.39],
"lineStyle": {
"normal": {
"type": "solid"
}
}
}],
[{
"coord": [119, 130.39],
"lineStyle": {
"normal": {
"type": "solid"
}
},
"name": ""
}, {
"coord": [122, 126.92],
"lineStyle": {
"normal": {
"type": "solid"
}
}
}],
[{
"coord": [122, 126.92],
"lineStyle": {
"normal": {
"type": "solid"
}
},
"name": ""
}, {
"coord": [136, 127.8],
"lineStyle": {
"normal": {
"type": "solid"
}
}
}]
]
}
}, {
"name": "Volumn",
"type": "bar",
"xAxisIndex": 1,
"yAxisIndex": 1,
"data": [416461, 687473, 505037, 1150238, 675520, 1089726, 373433, 446651, 398998, 511132, 247692, 273835,
267373, 398196, 366586, 520603, 459097, 500946, 461515, 814047, 523282, 465497, 425477, 451614,
717755, 659883, 589448, 429749, 669520, 594085, 1187631, 2724887, 1342535, 838827, 985020, 1291734,
1158455, 969570, 958085, 781557, 734702, 714488, 574195, 1020752, 580652, 868111, 463333, 512112,
487099, 623540, 426212, 635748, 420521, 589324, 527538, 459338, 772457, 556902, 638275, 568450,
454269, 556531, 683170, 334809, 423170, 611112, 660980, 489380, 630435, 600116, 662431, 389357,
617654, 397033, 1488742, 507910, 592317, 682617, 701320, 889302, 854788, 632929, 613689, 828304,
947725, 989587, 733934, 707441, 887512, 1227319, 811794, 999605, 1056075, 1428662, 3779970, 1684245,
1277448, 1151535, 977805, 1130272, 1109339, 1222223, 1022485, 1251676, 977459, 899018, 1061457,
782459, 1082349, 1271062, 655583, 662070, 740931, 717142, 376624, 354104, 488780, 1106204, 721461,
509525, 580872, 618032, 879899, 686569, 675191, 795374, 552809, 702714, 571681, 845071, 686766,
590674, 519745, 488380, 883094, 322898, 711695
],
"itemStyle": {
"normal": {
"color": "#91c7ae"
}
}
}],
"backgroundColor": "rgba(255,255,255,1)"
};