123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- // import Chart1 from "../../../src/chart/center/ChartCenterLine1/ChartCenterLine1";
- import Chart2 from "../../../src/chart/center/ChartCenterLine1/ChartCenterLine1";
- import Title from "../../../src/chart/commonOptions/title";
- // let bar1 = new Chart1(document.querySelector(".c1"), {});
- let bar2 = new Chart2(document.querySelector(".c2"), {});
- // bar2.setZoomCallBack(bar1.setZoomSlider);
- window.addEventListener("resize", function () {
- // bar1.resize();
- bar2.resize()
- });
- window.addEventListener("elementClick",(data)=>{
- console.log(data)
- })
- setTimeout(()=>{
- bar2.setOption( {
- color: ['#00deff','#3f90ff','#00f6ff','#0096ff','#d0e3ff','#4169e1','#00bfff','#008b8b','#00fa9a','#0000ff'],
- title: Title.option(''),
- bg: {
- backgroundColor: '#062541',
- },
- grid1:{
- left:"18%",
- right:"18%",
- top:"10%",
- bottom:"62%"
- },
- grid2:{
- left:"18%",
- right:"18%",
- top:"54%",
- bottom:"26%"
- },
- legend1:{
- itemHeight: 10,
- itemWidth: 10,
- itemAngelR: 20,
- left:'18%',
- top:'4%',
- textStyle:{
- color: '#8ca6ad'
- }
- },
- legend2: {
- itemHeight: 10,
- itemWidth: 10,
- itemAngelR: 20,
- left:'18%',
- top:'48%',
- textStyle:{
- color: '#8ca6ad'
- }
- },
- dataZoom:{
- show:true,
- position:"85%",
- zoomHeight:33,
- zoomMaskColor:"rgba(14,74,227,0.1)",
- zoomBackgroundColor:"rgba(0,0,0,0)",
- zoomAreaColor:"rgba(4,66,99,0.8)",
- zoomLineColor:"rgba(4,66,99,0.8)",
- zoomHandleColor:"#00deff"
- },
- tooltip: {
- // titleColor:'#fff',
- bgStyle:{
- backgroundColor:'rgba(0,0,0,0.7)',
- // borderColor:'#888e0e',
- // borderWidth:1
- },
-
- },
-
-
- xAxis1: {
- type: "category",
- // title: '日期',
- nameTextStyle: {
- fontSize: 12,
- color: '#797979',
- },
- namePosition: 'end',
- // data: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", '八月', '九月', '十月', '十一月', '十二月'],
- data: ['2011','2012','2013','2014','2015','2016','2017','2018','2019'],
- // boundaryGap: true,
- // scale: true,
- axisLine: {
- show: true,
- lineStyle: {
- color: '#275176',
- // opacity: 0.3,
- width: 4,
- // type: 'solid'
- }
- },
- axisTick: {
- show: false,
- alignWithLabel: false,
- // interval: 'auto'
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: 'rgba(255,255,255,0.3)',
- // opacity: 0.3,
- width: 1,
- type: 'solid'
- }
- },
- axisLabel: {
- show: true,
- margin:5,
- textStyle: {
- color: '#797979',
- textRotation: 0
- }
- }
- },
- yAxis1: {
- type: 'value',
- title: '',
- splitNumber:2,
- nameTextStyle: {
- fontSize: 12,
- color: '#797979',
- },
- namePosition: 'end',
- scale: true,
- axisLine: {
- show: true,
- lineStyle: {
- color: '#275176',
- opacity: 0.3,
- width: 4,
- type: 'solid'
- }
- },
- axisTick: {
- show: false,
- alignWithLabel: true,
- interval: 'auto',
- lineStyle: {
- color: '#ffffff',
- opacity: 0.3,
- width: 1
- }
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: '#ffffff',
- opacity: 0.3,
- width: 1,
- type: 'solid'
- }
- },
-
- axisLabel: {
- show: true,
- format:true,
- textStyle: {
- color: '#797979'
- }
- }
-
- },
-
-
- xAxis2: {
- type: "category",
- // title: '日期',
- nameTextStyle: {
- fontSize: 12,
- color: '#ccc',
- },
- namePosition: 'end',
- // data: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", '八月', '九月', '十月', '十一月', '十二月'],
- data: ['2011','2012','2013','2014','2015','2016','2017','2018','2019'],
- boundaryGap: true,
- // scale: true,
- axisLine: {
- show: false,
- lineStyle: {
- color: 'rgba(255,255,255,0.2)',
- width: 2,
- type: 'solid'
- }
- },
- axisTick: {
- show: false,
- alignWithLabel: true,
- length: -2,
- lineStyle:{
- width:2,
- color:'rgba(255,255,255,0.1)',
- // opacity: 0.1,
- }
- },
- splitLine: {
- show: false,
- lineStyle: {
- color: 'rgba(255,255,255,0.2)',
- width: 1,
- type: 'solid'
- }
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: '#797979',
- backgroundColor: 'rgba(255,255,255,0.05)',
- highlightColor: '#ffffff',
- textRotation:0,
- }
- }
- },
- yAxis2: {
- type: 'value',
- title: '',
- splitNumber:2,
- nameTextStyle: {
- fontSize: 12,
- color: '#606060',
- },
- namePosition: 'end',
- scale: true,
- axisLine: {
- show: true,
- lineStyle: {
- color: 'rgba(255,255,255,0.2)',
- width: 1,
- type: 'solid',
- distance: 2, //偏移距离
- }
- },
- axisTick: {
- show: true,
- alignWithLabel: false,
- length:-5,
- lineStyle:{
- width:2,
- color:'rgba(255,255,255,0.1)',
- // opacity: 0.1,
- }
- },
- splitLine: {
- show: false,
- lineStyle: {
- color: 'rgba(255,255,255,0.2)',
- // opacity: 0.2,
- width: 1,
- type: 'solid'
- }
- },
-
- axisLabel: {
- show: true,
- textStyle: {
- color: '#606060'
- }
- }
-
- },
- shape:{
- label: {
- show: false,
- textStyle: {
- fontSize: 12,
- fontWeight: 'normal',
- color: ''
- }
- },
- lineStyle: {
- width: 2,
- smooth: 'spline',
- },
- lineShadow: {
- // shadowColor: '#000000',
- shadowOffsetX: 0,
- shadowOffsetY: 0,
- shadowBlur: 5
- },
- circleSize: 5,
- bgGrid:{
- color: 'rgba(255,255,255,0.05)',
- }
- },
-
- series: [
- {
- name: '类别一',
- type: 'main',
- data: [0.45, 0.51, 0.67, 0.64, 0.55, 0.31, 0.57, 0.87, 0.89],
- },
- {
- name: '类别二',
- type: 'bar',
- data: [0.35,0.2, 0.25, 0.34, 0.3, 0.15, 0.16, 0.21, 0.27],
- },
- {
- name: '类别三',
- type: 'bar',
- data: [0.1, 0.31, 0.42, 0.3, 0.25, 0.16, 0.41, 0.66, 0.62],
- }
- ]
- })
- },2400)
-
|