| | |
| | | |
| | | var option; |
| | | |
| | | |
| | | |
| | | option = { |
| | | xAxis: { |
| | | type: 'category', |
| | | data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] |
| | | title: { |
| | | text: '年度进/出货量', |
| | | textStyle:{ |
| | | color:'#F8F8FF', |
| | | }, |
| | | subtext: 'Data', |
| | | subtextStyle:{ |
| | | color:'#F8F8FF', |
| | | }, |
| | | show: true, |
| | | |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | textStyle:{ |
| | | color:'#F8F8FF', |
| | | }, |
| | | // subtextStyle:{ |
| | | // color:'#F8F8FF', |
| | | // }, |
| | | // tooltip: { |
| | | // trigger: 'axis' |
| | | // }, |
| | | legend: { |
| | | show:false, |
| | | data: ['进货', '出货'] |
| | | }, |
| | | toolbox: { |
| | | show: false, |
| | | feature: { |
| | | dataView: { show: true, readOnly: false }, |
| | | magicType: { show: true, type: ['line', 'bar'] }, |
| | | restore: { show: true }, |
| | | saveAsImage: { show: true } |
| | | } |
| | | }, |
| | | calculable: true, |
| | | xAxis: [ |
| | | { |
| | | color:'#ffffff', |
| | | type: 'category', |
| | | // prettier-ignore |
| | | data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'] |
| | | } |
| | | ], |
| | | yAxis: [ |
| | | { |
| | | // show:false, |
| | | type: 'value' |
| | | } |
| | | ], |
| | | series: [ |
| | | { |
| | | data: [120, 200, 150, 80, 70, 110, 130], |
| | | type: 'bar' |
| | | color:['#F8F8FF'], |
| | | name: '进货', |
| | | type: 'bar', |
| | | data: [ |
| | | 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3 |
| | | ], |
| | | // markPoint: { |
| | | // data: [ |
| | | // { type: 'max', name: 'Max' }, |
| | | // { type: 'min', name: 'Min' } |
| | | // ] |
| | | // }, |
| | | // markLine: { |
| | | // data: [{ type: 'average', name: 'Avg' }] |
| | | // } |
| | | }, |
| | | { |
| | | color:['#C0C0C0'], |
| | | name: '出货', |
| | | type: 'bar', |
| | | data: [ |
| | | 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3 |
| | | ], |
| | | // markPoint: { |
| | | // data: [ |
| | | // { name: 'Max', value: 182.2, xAxis: 7, yAxis: 183 }, |
| | | // { name: 'Min', value: 2.3, xAxis: 11, yAxis: 3 } |
| | | // ] |
| | | // }, |
| | | // markLine: { |
| | | // data: [{ type: 'average', name: 'Avg' }] |
| | | // } |
| | | } |
| | | ] |
| | | ], |
| | | |
| | | }; |
| | | |
| | | option && myChart.setOption(option); |
| | | |
| | | |
| | | // option = { |
| | | // title: { |
| | | // text: '年度进/出货量', |
| | | // textStyle:{ |
| | | // color:'#F8F8FF', |
| | | // }, |
| | | // subtext: 'Data', |
| | | // subtextStyle:{ |
| | | // color:'#F8F8FF', |
| | | // }, |
| | | // show: true, |
| | | // |
| | | // }, |
| | | // textStyle:{ |
| | | // color:'#F8F8FF', |
| | | // }, |
| | | // // subtextStyle:{ |
| | | // // color:'#F8F8FF', |
| | | // // }, |
| | | // // tooltip: { |
| | | // // trigger: 'axis' |
| | | // // }, |
| | | // legend: { |
| | | // show:false, |
| | | // data: ['进货', '出货'] |
| | | // }, |
| | | // toolbox: { |
| | | // show: false, |
| | | // feature: { |
| | | // dataView: { show: true, readOnly: false }, |
| | | // magicType: { show: true, type: ['line', 'bar'] }, |
| | | // restore: { show: true }, |
| | | // saveAsImage: { show: true } |
| | | // } |
| | | // }, |
| | | // calculable: true, |
| | | // xAxis: [ |
| | | // { |
| | | // type: 'category', |
| | | // // prettier-ignore |
| | | // data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'] |
| | | // } |
| | | // ], |
| | | // yAxis: [ |
| | | // { |
| | | // // show:false, |
| | | // type: 'value' |
| | | // } |
| | | // ], |
| | | // series: [ |
| | | // { |
| | | // name: '进货', |
| | | // type: 'bar', |
| | | // data: [ |
| | | // 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3 |
| | | // ], |
| | | // markPoint: { |
| | | // data: [ |
| | | // { type: 'max', name: 'Max' }, |
| | | // { type: 'min', name: 'Min' } |
| | | // ] |
| | | // }, |
| | | // markLine: { |
| | | // data: [{ type: 'average', name: 'Avg' }] |
| | | // } |
| | | // }, |
| | | // { |
| | | // name: '出货', |
| | | // type: 'bar', |
| | | // data: [ |
| | | // 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3 |
| | | // ], |
| | | // markPoint: { |
| | | // data: [ |
| | | // { name: 'Max', value: 182.2, xAxis: 7, yAxis: 183 }, |
| | | // { name: 'Min', value: 2.3, xAxis: 11, yAxis: 3 } |
| | | // ] |
| | | // }, |
| | | // markLine: { |
| | | // data: [{ type: 'average', name: 'Avg' }] |
| | | // } |
| | | // } |
| | | // ], |
| | | // |
| | | // }; |
| | | // |
| | | // if (option && typeof option === 'object') { |
| | | // myChart.setOption(option); |
| | | // } |
| | | if (option && typeof option === 'object') { |
| | | myChart.setOption(option); |
| | | } |
| | | |
| | | </script> |
| | | <script type="text/javascript" src="../static/js/lib/jquery-3.3.1.min.js"></script> |