123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- import ChartLine from '../../../src/chart/line/ChartLine15/ChartLine15.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: ['#ffffff','#3fffa7','#3f90ff','#00f6ff','#0096ff','#d0e3ff','#4169e1','#00bfff','#008b8b','#00fa9a','#0000ff'],
- title: {},
- bg: {
- backgroundColor: '#000000'
- },
- grid: Grid.option,
- tooltip: {
- titleColor:'#fff',
- bgStyle:{
- backgroundColor:'rgba(255,255,255,0.2)',
- // borderColor:'#888e0e',
- // borderWidth:1
- },
- nameColor:'#ffda2a',
- valueColor:'#ffda2a'
-
- },
- legend: {
- itemHeight: 10,
- itemWidth: 10,
- itemAngelR: 20,
- 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','2017','2014','2015','2016','2017',],
- boundaryGap: true,
- // scale: true,
- axisLine: {
- show: false,
- lineStyle: {
- color: '#ffffff',
- opacity: 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(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,
- margin: 4,
- }
- }
- },
- yAxis: {
- type: 'value',
- title: '单位',
- nameTextStyle: {
- fontSize: 12,
- color: '#606060',
- },
- namePosition: 'end',
- scale: true,
- axisLine: {
- show: true,
- lineStyle: {
- color: '#ffffff',
- opacity: 0.2,
- width: 1,
- type: 'solid',
- distance: 2, //偏移距离
- }
- },
- axisTick: {
- show: true,
- alignWithLabel: false,
- length:-5,
- lineStyle:{
- width:2,
- color:'#ffffff',
- opacity: 0.1,
- }
- },
- splitLine: {
- show: false,
- lineStyle: {
- color: 'rgba(255,255,255,0.2)',
- width: 1,
- type: 'solid'
- }
- },
-
- axisLabel: {
- show: true,
- textStyle: {
- color: '#606060'
- }
- }
-
- },
- shape:{
- label: {
- show: false,
- textStyle: {
- fontSize: 12,
- fontWeight: 'normal',
- color: ''
- }
- },
- lineStyle: {
- width: 4,
- smooth: 'spline',
- },
- lineShadow: {
- // shadowColor: '#000000',
- shadowOffsetX: 0,
- shadowOffsetY: 0,
- shadowBlur: 5
- },
- circleSize: 5,
- bgGrid:{
- color: '#ffffff',
- opacity: 1,
- }
- },
- series: [
- {
- name: '类别一',
- type: 'bar',
- data: [800, 900, 600, 1200, 1300, 900, 1000,1200, 1300, 900, 1000,],
- }, {
- name: '类别二',
- type: 'bar',
-
- data: [1200, 1400, 650, 950, 1600, 1400, 1000,950, 1600, 1400, 1000],
- }
- ]
- };
|