123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- import ChartBar from '../../../src/chart/bar/ChartBar11/ChartBar11.js';
- 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);
- },3000);
- let opt={
- color: ["#7eb2e7", "#66ffff"],
- bg: {
- backgroundColor: '#161729'
- },
- title: Title.option('新经济普查工作'),
- grid: Grid.option,
- tooltip: {
- dangerline: {
- // show:true,
- // dangerData:68
- }
- },
- legend: {
- left: "45%",
- top: '6%',
- itemHeight: 12,
- itemWidth: 12,
- itemAngelR: 20,
- textStyle: {
- fontSize: 16,
- color: '#50a7bd'
- }
- },
- xAxis: {
- type: "category",
- name: '年份',
- nameTextStyle: {
- fontSize: 12,
- color: '#ccc',
- },
- namePosition: 'end',
- axisLine: {
- show: true,
- lineStyle: {
- color: '#00dff7',
- width: 2,
- type: 'solid'
- }
- },
- axisTick: {
- show: false,
- alignWithLabel: false
- },
- splitLine: {
- show: false,
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: '#50a7bd'
- }
- },
- highLightColor: '#005eb8',
- data: [2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016],
- },
- yAxis: {
- type: 'value',
- title: '(%)',
- nameTextStyle: {
- color: '#66ffff',
- fontSize: 14
- },
- axisLine: {
- show: true,
- color: '#00dcff'
- },
- axisTick: {
- show: true,
- lineStyle: {
- color: '#cee1ff',
- width: 2
- },
- length: 3,
- alignWithLabel: true
- },
- splitLine: {
- show: true
- },
- axisLabel: {
- textStyle: {
- color: '#66ffff'
- }
- },
- },
- shape:{
- barGap: '80%',
- barCategoryGap: '40%',
- label: {
- show:true,
- textStyle: {
- fontSize: 14,
- fontWeight: 'normal',
- color: '#fff'
- }
-
- },
- },
- series: [ {
- name: '行业2',
- type: 'bar',
-
- data: [610, 860, 600, 1300, 1300, 700, 580, 750, 1280]
- }
-
- ]
-
- }
|