Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7053953

Browse files
committed
echarts mod
1 parent e3ec0be commit 7053953

File tree

1 file changed

+51
-5
lines changed

1 file changed

+51
-5
lines changed

‎src/views/echarts/dynamic-chart.vue

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,44 @@
11
<template>
22
<div class="slideCharts">
33
<div class="chartBox">
4-
<el-button @click="setChartData(10)">10天</el-button>
5-
<el-button @click="setChartData(30)">30天</el-button>
6-
<el-button @click="setChartData(60)">60天</el-button>
7-
<el-button @click="setChartData(180)">180天</el-button>
4+
<div class="btns">
5+
<el-button
6+
:class="{ active: shows === 1 }"
7+
size="small"
8+
@click="
9+
setChartData(10)
10+
shows = 1
11+
"
12+
>10天</el-button
13+
>
14+
<el-button
15+
:class="{ active: shows === 2 }"
16+
size="small"
17+
@click="
18+
setChartData(30)
19+
shows = 2
20+
"
21+
>30天</el-button
22+
>
23+
<el-button
24+
:class="{ active: shows === 3 }"
25+
size="small"
26+
@click="
27+
setChartData(60)
28+
shows = 3
29+
"
30+
>60天</el-button
31+
>
32+
<el-button
33+
:class="{ active: shows === 4 }"
34+
size="small"
35+
@click="
36+
setChartData(180)
37+
shows = 4
38+
"
39+
>180天</el-button
40+
>
41+
</div>
842
<div ref="myCharts" class="chartBox_d"></div>
943
</div>
1044
</div>
@@ -19,6 +53,7 @@ export default {
1953
data() {
2054
return {
2155
mycharts: null,
56+
shows: 1,
2257
date: [],
2358
price: [],
2459
chartData: {
@@ -136,10 +171,21 @@ export default {
136171
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
137172
background: #fff;
138173
height: 100%;
174+
position: relative;
139175
.chartBox_d {
140-
height: 80%;
176+
height: 100%;
141177
box-sizing: border-box;
142178
padding: 30px 20px 30px 20px;
143179
}
180+
.btns {
181+
position: absolute;
182+
right: 40px;
183+
top: 20px;
184+
z-index: 99;
185+
.el-button.active {
186+
color: #3a8ee6;
187+
background: #ddeeff;
188+
}
189+
}
144190
}
145191
</style>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /