Commit b1030caf authored by huangzihao's avatar huangzihao

up

parent a9a6516d
......@@ -245,11 +245,11 @@ const lineChartOption = (xData, yData, interval) => {
/**
* echartjs 饼图通用配置
*/
const pieChartOption = (data, isPercent) => {
const pieChartOption = (data, isPercent, unit) => {
return {
tooltip: {
trigger: "item",
formatter: isPercent ? "{b}: {c}" : "{b}: {d}%",
formatter: isPercent ? "{b}: {c}" + unit : "{b}: {d}%",
},
series: [
{
......@@ -268,7 +268,7 @@ const pieChartOption = (data, isPercent) => {
if (isPercent) {
return param.name + ": " + param.percent + "%";
} else {
return param.name + ": " + param.value;
return param.name + ": " + param.value + unit;
}
},
},
......@@ -505,12 +505,12 @@ const leftLineChart = () => {
);
const pieChart3 = echarts.init(document.getElementById("pie_chart_3"));
pieChart3.setOption(pieChartOption(echart3Data, true));
pieChart3.setOption(pieChartOption(echart3Data, true, " kW"));
};
const rightLineChart = () => {
const pieChart4 = echarts.init(document.getElementById("pie_chart_4"));
pieChart4.setOption(pieChartOption(echart4Data));
pieChart4.setOption(pieChartOption(echart4Data, false, " kW"));
const lineChart5 = echarts.init(document.getElementById("line_chart_5"));
lineChart5.setOption(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment