123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- define(function (require) {
- var $chart;
- return function (context) {
- return {
- north: {
- height: 400,
- border: false,
- items: {
- xtype: 'layout',
- west: {
- width: '50%',
- border: false,
- items: {
- xtype: 'echarts',
- onRender: function () {
- $chart = $(this);
- $chart.echarts({
- title: {
- text: '产品A销售示意图',
- left: 'center',
- top: '13'
- },
- xAxis: {
- type: 'category',
- data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
- axisLabel: { formatter: '{value}月' }
- },
- yAxis: {
- type: 'value',
- axisLabel: { formatter: '{value}件' }
- },
- series: [{
- data: [820, 932, 901, 934, 1290, 1330, 1320, 901, 934, 1290, 1330, 1320],
- type: 'line'
- }],
- color: ['red']
- });
- }
- }
- },
- center: {
- border: false,
- items: {
- xtype: 'echarts',
- onRender: function () {
- $chart = $(this);
- $chart.echarts({
- title: {
- text: '仓库上月各类产品销售示意图',
- x: 'center',
- top: '30'
- },
- tooltip: {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)"
- },
- series: [
- {
- name: '当前产品信息',
- type: 'pie',
- radius: '55%',
- center: ['50%', '60%'],
- data: [
- { value: 335, name: '产品A' },
- { value: 310, name: '产品B' },
- { value: 234, name: '产品C' },
- { value: 135, name: '产品D' },
- { value: 1548, name: '产品E' }
- ],
- itemStyle: {
- emphasis: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- }
- }
- ]
- });
- }
- }
- }
- }
- },
- center: {
- border: false,
- items: {
- xtype: 'echarts',
- onRender: function () {
- $chart = $(this);
- },
- title: {
- text: '产品销售示意图',
- left: 'center',
- },
- xAxis: {
- data: ["大白兔奶糖", "狂神篮球", "白色T恤", "产品1", "产品2", "夹板"]
- },
- yAxis: {},
- series: [{
- name: '销量',
- type: 'bar',
- data: [5, 20, 36, 10, 10, 20]
- }],
- color: ['#004c8b']
- }
- }
- };
- };
- }
- );
|