123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- import ChartLine from '../../../src/chart/line/ChartLine16/ChartLine16.js';
- import Grid from '../../../src/chart/commonOptions/grid'
-
- let chart = new ChartLine(document.getElementsByClassName('c1')[0], {});
- window.addEventListener('resize', () => {
- chart.resize();
- });
-
-
- // setTimeout(()=>{
- // chart.setOption(option)
- // },2000)
-
- let option = {
- color: ['#3fffa7','#3f90ff','#00f6ff','#0096ff','#d0e3ff','#4169e1','#00bfff','#008b8b','#00fa9a','#0000ff'],
- title: {},
- bg: {
- backgroundColor: '#000000'
- },
- grid: Grid.containLabelOption,
- tooltip: {
- // titleColor:'#fff',
- bgStyle:{
- backgroundColor:'rgba(0,0,0,0.7)',
- // borderColor:'#888e0e',
- // borderWidth:1
- },
- nameColor:'#ffffff',
- valueColor:'#ffffff'
-
- },
- legend: {
- itemHeight: 10,
- itemWidth: 10,
- // itemAngelR: 0,
- left:'22%',
- top:'8%',
- textStyle:{
- color: '#ffffff'
- }
- },
- xAxis: {
- type: "category",
- // title: '日期',
- nameTextStyle: {
- fontSize: 12,
- color: '#ccc',
- },
- namePosition: 'end',
- // data: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", '八月', '九月', '十月', '十一月', '十二月'],
- data: ['2011','2012','2013','2014','2015','2016','2012','2013','2014','2015','2016'],
- 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: true,
- lineStyle: {
- color: 'rgba(102,102,102,0.2)',
- width: 1,
- type: 'solid'
- }
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: '#bdbdbd',
- backgroundColor: 'rgba(255,255,255,0.05)',
- highlightColor: 'rgba(255,255,255,0.4)',
- textRotation:0,
- }
- }
- },
- yAxis: {
- type: 'value',
- title: '单位',
- 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,
- },
- bgGrid:{
- color: 'rgba(255,255,255,0.05)',
- }
- },
- series: [
- {
- name: '类别',
- type: 'bar',
- data: [110, 3, 6, 14,90, 17, 3, 6, 14,90, 17],
- }
- ]
- };
|