123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367 |
- import ChartBar from '../../../src/chart/bar/ChartBar4/ChartBar4.js';
- import Title from "../../../src/chart/commonOptions/title";
- import Grid from "../../../src/chart/commonOptions/grid";
- import Legend from "../../../src/chart/commonOptions/legend";
- import Tooltip from "../../../src/chart/commonOptions/tooltip";
- // import Title from "../../../src/chart/commonOptions/title";
- // import Grid from "../../../src/chart/commonOptions/grid";
-
- let bar = new ChartBar(document.getElementsByClassName('c1')[0], {});
- window.addEventListener('resize', () => {
- bar.resize();
- });
-
- setTimeout(() => {
- // bar.setOption(opt)
- }, 2000);
- setTimeout(() => {
- // bar.setOption(opt2)
- }, 4000);
- let opt = {
- color: ['#ff0000'],
- bg:{
- backgroundColor:'#000713'
- },
- title: Title.option('新经济普查工作'),
- grid:{
- left:'18%',
- top:'20%',
- right:'18%',
- bottom:'18%',
- containLabel: false
- },
- tooltip: Tooltip.option,
- legend: Legend.option,
- carousel: {
- show: false,
- showColumn: 3,
- r:20,
- color:'#ffff00',
- open: false
- },
- xAxis: {
- type: "category",
- data: ['地区一', '地区二', '地区三', '地区四', '地区五', '地区六', '地区七', '地区八'],
- axisLine: {
- show: true,
- lineStyle: {
- color: '#224c69',
- width: 2,
- }
- },
- axisTick: {
- show: true,
- alignWithLabel: true,
- interval: 'auto',
- length:3,
- lineStyle: {
- color: '#ffff00'
- }
- },
-
- axisLabel: {
- show: true,
- textStyle:{
- color:'#54b3ea'
- }
- // margin: 0,
- },
- splitLine: {
- show: false,
- lineStyle: {
- color: '#26426a',
- width: 1,
-
- }
- }
-
- },
- yAxis: {
- type: 'value',
- title:'(%)',
- nameTextStyle:{
- color:'#54b3ea'
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: '#224c69',
- width: 2,
- type: 'solid'
- }
- },
- splitLine: {
- show: false,
- lineStyle: {
- color: '#26426a',
- width: 1,
- type: 'solid'
- }
- },
- axisTick: {
- show: true,
- interval: 'auto',
- length:3,
- lineStyle: {
- color: '#ffff00',
- }
- },
- axisLabel: {
- show: true,
- textStyle:{
- color:'#54b3ea'
- }
- // margin: 0,
- },
-
- },
-
- shape:{
- barCategoryGap: '30%',
- label: {
- show: false,
- textStyle: {
- fontSize: 12,
- fontWeight: 'normal',
- color: ''
-
- //'' 表示使用series默认颜色数组
- }
- }
- },
- series: [
- {
- name: '行业总产值',
- type: 'bar',
- data: [91,86,82,78,74,79,67,89]
- }
- ]
- };
- let opt2 = {
- color: ['#ffff00'],
- bg:{
- backgroundColor:'#000713'
- },
- title: Title.option('新经济普查工作'),
- grid:{
- left:'18%',
- top:'20%',
- right:'18%',
- bottom:'18%',
- containLabel: false
- },
- tooltip: Tooltip.option,
- legend: Legend.option,
- carousel: {
- show: true,
- showColumn: 2,
- r:20,
- color:'#ffff00',
- open: false
- },
- xAxis: {
- type: "category",
- data: ['地区一', '地区二', '地区三', '地区四', '地区五', '地区六', '地区七', '地区八'],
- axisLine: {
- show: true,
- lineStyle: {
- color: '#224c69',
- width: 2,
- }
- },
- axisTick: {
- show: true,
- alignWithLabel: true,
- interval: 'auto',
- length:3,
- lineStyle: {
- color: '#ffff00'
- }
- },
-
- axisLabel: {
- show: true,
- textStyle:{
- color:'#54b3ea'
- }
- // margin: 0,
- },
- splitLine: {
- show: false,
- lineStyle: {
- color: '#26426a',
- width: 1,
-
- }
- }
-
- },
- yAxis: {
- type: 'value',
- title:'(%)',
- nameTextStyle:{
- color:'#54b3ea'
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: '#224c69',
- width: 2,
- type: 'solid'
- }
- },
- splitLine: {
- show: false,
- lineStyle: {
- color: '#26426a',
- width: 1,
- type: 'solid'
- }
- },
- axisTick: {
- show: true,
- interval: 'auto',
- length:3,
- lineStyle: {
- color: '#ffff00',
- }
- },
- axisLabel: {
- show: true,
- textStyle:{
- color:'#54b3ea'
- }
- // margin: 0,
- },
-
- },
-
- shape:{
- barCategoryGap: '30%',
- label: {
- show: false,
- textStyle: {
- fontSize: 12,
- fontWeight: 'normal',
- color: ''
-
- //'' 表示使用series默认颜色数组
- }
- }
- },
- series: [
- {
- name: '行业总产值',
- type: 'bar',
- data: [91,86,82,78,74,79,67,89]
- }
- ]
- };
- // bar.setOption( {
- // color: ['#02e4ff'],
- // bg:{
- // backgroundColor:'#000713'
- // },
- // title: Title.option('新经济普查工作'),
- // grid: Grid.option,
- // tooltip: {},
- // legend: Legend.option,
- // xAxis: {
- // type: "category",
- // data: ['地区一', '地区二', '地区三', '地区四', '地区五', '地区六', '地区七'],
- // axisLine: {
- // show: true,
- // lineStyle: {
- // color: '#224c69',
- // width: 2,
- // }
- // },
- // axisTick: {
- // show: true,
- // alignWithLabel: true,
- // interval: 'auto',
- // length:3,
- // lineStyle: {
- // color: '#ffff00'
- // }
- // },
-
- // axisLabel: {
- // show: true,
- // textStyle:{
- // color:'#54b3ea'
- // }
- // // margin: 0,
- // },
- // splitLine: {
- // show: false,
- // lineStyle: {
- // color: '#26426a',
- // width: 1,
-
- // }
- // }
-
- // },
- // yAxis: {
- // type: 'value',
- // title:'(%)',
- // nameTextStyle:{
- // color:'#54b3ea'
- // },
- // axisLine: {
- // show: true,
- // lineStyle: {
- // color: '#224c69',
- // width: 2,
- // type: 'solid'
- // }
- // },
- // splitLine: {
- // show: false,
- // lineStyle: {
- // color: '#26426a',
- // width: 1,
- // type: 'solid'
- // }
- // },
- // axisTick: {
- // show: true,
- // interval: 'auto',
- // length:3,
- // lineStyle: {
- // color: '#ffff00',
- // }
- // },
- // axisLabel: {
- // show: true,
- // textStyle:{
- // color:'#54b3ea'
- // }
- // // margin: 0,
- // },
-
- // },
- // shape:{
- // barCategoryGap: '30%',
- // label: {
- // show: false,
- // textStyle: {
- // fontSize: 12,
- // fontWeight: 'normal',
- // color: ''
-
- // //'' 表示使用series默认颜色数组
- // }
- // },
- // },
- // series: [
- // {
- // name: '行业总产值',
- // type: 'bar',
-
- // data: [91,86,82,78,74,79,67]
- // }
- // ]
- // })
-
|