From 2d445a7f255343099b4647ea5ce51d2980768003 Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Thu, 28 Sep 2023 16:45:41 +0800
Subject: [PATCH] fix:立行立改
---
src/components/Echarts/LineChart2.vue | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 47 insertions(+), 1 deletions(-)
diff --git a/src/components/Echarts/LineChart2.vue b/src/components/Echarts/LineChart2.vue
index 5423c18..d32faf0 100644
--- a/src/components/Echarts/LineChart2.vue
+++ b/src/components/Echarts/LineChart2.vue
@@ -27,6 +27,10 @@
type: Boolean,
default: true,
},
+ isMouse: {
+ type: Boolean,
+ default: false,
+ },
chartData: {
type: Object,
required: true,
@@ -89,6 +93,42 @@
return res * fontSize
}
let that = this
+ if (this.isMouse) {
+ this.chart.on('mouseover', function (params) {
+ that.chart.setOption({
+ series: [
+ {
+ name: params.seriesName,
+ label: {
+ show: true,
+ fontSize: 16,
+ position: [10, -15],
+ formatter: '{c}'
+ }
+ }
+ ]
+ })
+ })
+ // ���������������mouseout������������������������
+ this.chart.on('mouseout', function (params) {
+ that.chart.setOption({
+ series: [
+ {
+ name: params.seriesName,
+ lineStyle: {
+ width: 2
+ },
+ label: {
+ show: false
+ },
+ endLabel: {
+ show: false
+ }
+ }
+ ]
+ })
+ })
+ }
this.chart.setOption(
{
title: {
@@ -188,8 +228,14 @@
yAxis: {
axisTick: {
- show: false, // ������������
+ show: true, // ������������
},
+ axisLine: {
+ show: true, //���������������������
+ },
+ axisLabel: {
+ show: true, //������������������������������
+ }
// axisLine: {
// lineStyle: {
// color: '#000000'
--
Gitblit v1.8.0