Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initBarchart = data => {
const _this = this;
const cityArr = data.map(i => i.Q1);
const dom = document.getElementById('icu-bar-charts');
const myChart = echarts.init(dom);
const option = {
title: {
text: '加班情况统计条形图',
subtext: '数据来自https://cloudqa.iego.cn/sr/icu996'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: val => {
const Q4 = val[0]; // 加班情况
const Q5 = val[1]; // 加班工资
const Q6 = val[2]; // 加班调休
return `公司名称:${Q4.name}<br>加班情况:${
mapReverse[Q4.value]
initChart() {
this.chart = echarts.init(this.$el, 'macarons');
this.chart.setOption({
tooltip: {
trigger: 'axis',
axisPointer: { // Axis indicator, axis trigger is valid
type: 'shadow', // The default is a straight line, which can be selected as: 'line' | 'shadow'
},
},
grid: {
top: 10,
left: '2%',
right: '2%',
bottom: '3%',
containLabel: true,
},
xAxis: [{
// labelLine: {
// normal: {
// show: false
// }
// },
data: [
{ value: 400, name: '交易完成' },
{ value: 300, name: '支付订单' },
{ value: 200, name: '生成订单' },
{ value: 100, name: '放入购物车' },
{ value: 100, name: '浏览网站' }
]
}
]
};
this.dom = echarts.init(this.$refs.dom, 'tdTheme');
this.dom.setOption(option);
on(window, 'resize', this.resize);
});
}
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
}
}
initChart () {
this.chart = echarts.init(document.getElementById(this.id))
var that = this
this.chart.setOption({
animationDuration: 5000,
backgroundColor: this.getColor(this.backgroundColor),
title: {
text: this.title,
top: '8%',
left: '8%',
textStyle: {
color: 'Orange'
}
},
legend: {
data: this.title,
textStyle: {
color: this.getColor(this.textColor)
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.chart.setOption({
xAxis: {
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
boundaryGap: false
},
grid: {
left: 10,
right: 10,
bottom: 20,
containLabel: true
},
tooltip: {
trigger: 'axis',
axisPointer: {
async mounted () {
this.$dt.behavior('/userbehavior/online_time', '用户在线时长', window.location.href)
let pic = echart.init(this.$refs.pic)
this.pic = pic
this.getLineData()
}
}
function addBarChart(id, config) {
let el_chart = document.getElementById(id);
self.charts[id] = echarts.init(el_chart);
self.charts[id].setOption({
title: { text: config.title },
tooltip: {},
xAxis: {
data: config.xTitle
},
yAxis: {},
series: [{
name: config.seriesName,
type: 'bar',
data: config.data
}]
});
}
self.allCharts.forEach(function (chart) {
},
{
name:'Location',
type:'pie',
radius: ['50%', '70%'],
data: Utils.flatMap(data, item => Object.keys(item.location).map(key => ({
value: item.location[key],
name: (item.successful ? 'Successful' : 'Failed') + '_' + key
})))
}
]
});
});
var amountChart = echarts.init(this.charts.amount);
var amountMin = 1;
var amountMax = 100;
StatUtils.getAmount().then(data => {
data = data.sort((a, b) => b._id - a._id);
var tmp = {};
var j = 0;
for (var i = amountMax; i >= amountMin; i--) {
tmp[i] = tmp[i + 1] || 0;
for (; (!data[j] || data[j]._id >= i) && j < data.length; j++) {
tmp[i] += data[j].count;
}
}
amountChart.setOption({
grid: {
left: 50
},