-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(line): line display error while use dataZoom
when use string data in series.m sometimes will trigger display error, such as the title say, and use array data will not. fixed #394 #387
- Loading branch information
1 parent
f2ff77e
commit 696798d
Showing
2 changed files
with
218 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
|
||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script> | ||
<script src="../../../../lib/index.min.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/v-charts/lib/style.min.css"> | ||
<title>RunJS 演示代码</title> | ||
</head> | ||
|
||
<body> | ||
<div id="example"> | ||
<button @click="select"> | ||
切换 | ||
</button> | ||
|
||
<ve-line :data="chartData" :data-zoom="{ start: 20, end: 100 }"></ve-line> | ||
</div> | ||
<script> | ||
var vm = new Vue({ | ||
el: '#example', | ||
data: { | ||
chartData: { | ||
columns: ['月份', '用戶數'], | ||
rows: [{ | ||
"月份": "2017-01", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-02", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-03", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-04", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-05", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-06", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-07", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-08", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-09", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-10", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-11", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-12", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2018-01", | ||
'用戶數': 1, | ||
}, { | ||
"月份": "2018-02", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2018-03", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2018-04", | ||
'用戶數': 4, | ||
}, { | ||
"月份": "2018-05", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2018-06", | ||
'用戶數': 0 | ||
}], | ||
}, | ||
list1: { | ||
columns: ['月份', '用戶數'], | ||
rows: [{ | ||
"月份": "2017-01", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-02", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-03", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-04", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-05", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-06", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-07", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-08", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-09", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-10", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-11", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-12", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2018-01", | ||
'用戶數': 1, | ||
}, { | ||
"月份": "2018-02", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2018-03", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2018-04", | ||
'用戶數': 4, | ||
}, { | ||
"月份": "2018-05", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2018-06", | ||
'用戶數': 0 | ||
}], | ||
}, | ||
list2: { | ||
columns: ['月份', '用戶數'], | ||
rows: [{ | ||
"月份": "2017-01", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-02", | ||
'用戶數': 3, | ||
}, { | ||
"月份": "2017-03", | ||
'用戶數': 2, | ||
}, { | ||
"月份": "2017-04", | ||
'用戶數': 8, | ||
}, { | ||
"月份": "2017-05", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-06", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-07", | ||
'用戶數': 4, | ||
}, { | ||
"月份": "2017-08", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-09", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-10", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2017-11", | ||
'用戶數': 5, | ||
}, { | ||
"月份": "2017-12", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2018-01", | ||
'用戶數': 1, | ||
}, { | ||
"月份": "2018-02", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2018-03", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2018-04", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2018-05", | ||
'用戶數': 0, | ||
}, { | ||
"月份": "2018-06", | ||
'用戶數': 0 | ||
}], | ||
} | ||
|
||
}, | ||
methods: { | ||
select: function() { | ||
this.chartData = this.chartData == this.list1 ? this.list2 : this.list1 | ||
} | ||
} | ||
}) | ||
</script> | ||
</body> | ||
|
||
</html> |