feat: 修改图表
This commit is contained in:
parent
e8d28126ad
commit
0dd7648593
|
@ -42,8 +42,10 @@
|
|||
></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-container>
|
||||
<el-main class="nopadding">
|
||||
<el-container>
|
||||
<el-aside style="width: 50%; float: right;">
|
||||
<!-- 折线图组件 -->
|
||||
<scTable
|
||||
ref="table"
|
||||
:apiObj="apiObj"
|
||||
|
@ -95,12 +97,12 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
<el-aside style="width: 50%; float: right;">
|
||||
<!-- 折线图组件 -->
|
||||
<scEcharts :option="chartOption" height="400px" />
|
||||
</el-aside>
|
||||
<el-main>
|
||||
<scEcharts :option="chartOption" height="400px" />
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<el-dialog title="校正" v-model="visible">
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
|
@ -167,7 +169,7 @@ export default {
|
|||
end_time: null
|
||||
},
|
||||
chartOption: {
|
||||
color: ["#80FFA5", "#00DDFF", "#37A2FF", "#FF0087", "#FFBF00"],
|
||||
color: ["#191970"],
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
|
@ -232,14 +234,13 @@ export default {
|
|||
|
||||
option.series = [
|
||||
{
|
||||
name: '总生产',
|
||||
name: tableData[0].mpoint_name,
|
||||
type: 'line', // 折线图类型
|
||||
data: tableData.map((item) => parseFloat(item.val)), // 将字符串转为数字
|
||||
smooth: true, // 平滑曲线
|
||||
}
|
||||
];
|
||||
option.legend.data = ['总生产'];
|
||||
|
||||
option.legend.data = [tableData[0].mpoint_name];
|
||||
// 更新图表选项
|
||||
that.chartOption = option;
|
||||
},
|
||||
|
@ -254,7 +255,6 @@ export default {
|
|||
},
|
||||
handle_add() {},
|
||||
handleQuery() {
|
||||
console.log(this.query)
|
||||
if (this.timeRange) {
|
||||
this.query.start_time = this.timeRange[0]
|
||||
this.query.end_time = this.timeRange[1]
|
||||
|
|
Loading…
Reference in New Issue