Browse Source

优化

master
陈裕财 4 years ago
parent
commit
00f76d80f9
  1. 2
      package.json
  2. 3
      src/main.js
  3. 101
      src/views/xm/rpt/product/productWorkItemDayList.vue

2
package.json

@ -22,7 +22,7 @@
"decimal.js": "^10.2.0", "decimal.js": "^10.2.0",
"driver.js": "^0.9.8", "driver.js": "^0.9.8",
"dropzone": "5.2.0", "dropzone": "5.2.0",
"echarts": "3.8.5",
"echarts": "^5.3.2",
"element-ui": "^2.13.0", "element-ui": "^2.13.0",
"file-saver": "2.0.1", "file-saver": "2.0.1",
"font-awesome": "4.7.0", "font-awesome": "4.7.0",

3
src/main.js

@ -16,8 +16,7 @@ import './icons' // icon
import './errorLog'// error log import './errorLog'// error log
import './permission' // permission control import './permission' // permission control
//import './mock' // simulation data //import './mock' // simulation data
import echarts from 'echarts'
import 'echarts/map/js/china.js'
import * as echarts from 'echarts'
import * as filters from './filters' // global filters import * as filters from './filters' // global filters
import Print from 'vue-print-nb' import Print from 'vue-print-nb'

101
src/views/xm/rpt/product/productWorkItemDayList.vue

@ -57,7 +57,7 @@
}, },
dataSetCpd(){ dataSetCpd(){
return [ return [
['date',...this.datesCpd],
['日期',...this.datesCpd],
['故事数',...this.menuNumCpd], ['故事数',...this.menuNumCpd],
['缺陷数',...this.bugNumCpd], ['缺陷数',...this.bugNumCpd],
['任务数',...this.taskNumCpd] ['任务数',...this.taskNumCpd]
@ -118,6 +118,25 @@
}, },
drawCharts() { drawCharts() {
this.myChart = this.$echarts.init(document.getElementById("productWorkItemDayList")); this.myChart = this.$echarts.init(document.getElementById("productWorkItemDayList"));
var that=this;
this.myChart.on('updateAxisPointer', function (event) {
const xAxisInfo = event.axesInfo[0];
if (xAxisInfo) {
const dimension = xAxisInfo.value + 1;
that.myChart.setOption({
series: {
id: 'pie',
label: {
formatter: '{b}: {@[' + dimension + ']} ({d}%)'
},
encode: {
value: dimension,
tooltip: dimension
}
}
});
}
});
this.myChart.setOption({ this.myChart.setOption({
title: { title: {
text: '工作项分布', text: '工作项分布',
@ -138,62 +157,23 @@
yAxis: { gridIndex: 0 }, yAxis: { gridIndex: 0 },
grid: { top: '55%' }, grid: { top: '55%' },
series: [ series: [
{
name: '故事数',
{
type: 'line', type: 'line',
seriesLayoutBy: 'row', seriesLayoutBy: 'row',
smooth:true, smooth:true,
emphasis: { focus: 'series' },
// stack: '',
itemStyle: {
normal: {
//
color: 'green',
lineStyle: {
// 线
color: 'green'
}
}
},
// data: this.opinionData,
emphasis: { focus: 'series' },
}, },
{
name: '任务数',
{
type: 'line', type: 'line',
seriesLayoutBy: 'row', seriesLayoutBy: 'row',
smooth:true, smooth:true,
emphasis: { focus: 'series' },
// stack: '',
itemStyle: {
normal: {
//
color: 'blue',
lineStyle: {
// 线
color: 'blue'
}
}
},
// data: this.opinionData,
emphasis: { focus: 'series' },
}, },
{
name: '缺陷数',
{
type: 'line', type: 'line',
seriesLayoutBy: 'row', seriesLayoutBy: 'row',
smooth:true, smooth:true,
emphasis: { focus: 'series' },
// stack: '',
itemStyle: {
normal: {
//
color: 'orange',
lineStyle: {
// 线
color: 'orange'
}
}
},
// data: this.opinionData,
emphasis: { focus: 'series' },
}, },
{ {
type: 'pie', type: 'pie',
@ -204,35 +184,16 @@
focus: 'self' focus: 'self'
}, },
label: { label: {
formatter: '{b}: {@2012} ({d}%)'
formatter: '{b}: {@日期} ({d}%)'
}, },
encode: { encode: {
itemName: 'date',
value: '2012',
tooltip: '2012'
itemName: '日期',
value: '日期',
tooltip: '日期'
} }
} }
] ]
});
this.myChart.on('updateAxisPointer', function (event) {
const xAxisInfo = event.axesInfo[0];
if (xAxisInfo) {
const dimension = xAxisInfo.value + 1;
this.myChart.setOption({
series: {
id: 'pie',
label: {
formatter: '{b}: {@[' + dimension + ']} ({d}%)'
},
encode: {
value: dimension,
tooltip: dimension
}
}
});
}
});
});
} }
},//end method },//end method
mounted() { mounted() {

Loading…
Cancel
Save