mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-08-16 12:52:48 +08:00
update readme & minor code update
This commit is contained in:
45
README.md
45
README.md
@ -171,7 +171,7 @@ See more examples [here](https://github.com/Justineo/vue-echarts/tree/master/dem
|
|||||||
|
|
||||||
* `options` **[reactive]**
|
* `options` **[reactive]**
|
||||||
|
|
||||||
Used to update data for ECharts instance. Modifying this property will trigger ECharts' `setOptions` method.
|
Used to update data for ECharts instance. Modifying this property will trigger ECharts' `setOption` method.
|
||||||
|
|
||||||
* `group` **[reactive]**
|
* `group` **[reactive]**
|
||||||
|
|
||||||
@ -183,9 +183,9 @@ See more examples [here](https://github.com/Justineo/vue-echarts/tree/master/dem
|
|||||||
|
|
||||||
### Instance Methods
|
### Instance Methods
|
||||||
|
|
||||||
* `mergeOptions` (`setOptions` in ECharts)
|
* `mergeOptions` (`setOption` in ECharts)
|
||||||
|
|
||||||
*Providing a better method name to describe the actual behavior of `setOptions.`*
|
*Providing a better method name to describe the actual behavior of `setOption.`*
|
||||||
|
|
||||||
* `resize`
|
* `resize`
|
||||||
* `dispatchAction`
|
* `dispatchAction`
|
||||||
@ -206,7 +206,44 @@ See more examples [here](https://github.com/Justineo/vue-echarts/tree/master/dem
|
|||||||
* `registerMap`
|
* `registerMap`
|
||||||
* `registerTheme`
|
* `registerTheme`
|
||||||
|
|
||||||
You can refer to [ECharts' API](http://echarts.baidu.com/api.html) to learn how to use the methods above.
|
### Events
|
||||||
|
|
||||||
|
Vue-ECharts support the following events:
|
||||||
|
|
||||||
|
* `legendselectchanged`
|
||||||
|
* `legendselected`
|
||||||
|
* `legendunselected`
|
||||||
|
* `datazoom`
|
||||||
|
* `datarangeselected`
|
||||||
|
* `timelinechanged`
|
||||||
|
* `timelineplaychanged`
|
||||||
|
* `restore`
|
||||||
|
* `dataviewchanged`
|
||||||
|
* `magictypechanged`
|
||||||
|
* `geoselectchanged`
|
||||||
|
* `geoselected`
|
||||||
|
* `geounselected`
|
||||||
|
* `pieselectchanged`
|
||||||
|
* `pieselected`
|
||||||
|
* `pieunselected`
|
||||||
|
* `mapselectchanged`
|
||||||
|
* `mapselected`
|
||||||
|
* `mapunselected`
|
||||||
|
* `axisareaselected`
|
||||||
|
* `brush`
|
||||||
|
* `brushselected`
|
||||||
|
* Mouse events
|
||||||
|
* `chartclick`
|
||||||
|
* `chartdblclick`
|
||||||
|
* `chartmouseover`
|
||||||
|
* `chartmouseout`
|
||||||
|
* `chartmousedown`
|
||||||
|
* `chartmouseup`
|
||||||
|
* `chartglobalout`
|
||||||
|
|
||||||
|
Notice that mouse event names are prefixed with `chart` to prevent collision with Vue's native mouse events.
|
||||||
|
|
||||||
|
For further details, see [ECharts' API documentation](https://ecomfe.github.io/echarts-doc/public/en/api.html).
|
||||||
|
|
||||||
## Local development
|
## Local development
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ h2 small {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p small {
|
p small {
|
||||||
font-size: 0.8em;
|
font-size: .8em;
|
||||||
color: #7f8c8d;
|
color: #7f8c8d;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,9 +94,9 @@ p {
|
|||||||
|
|
||||||
pre {
|
pre {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 0.8em;
|
padding: .8em;
|
||||||
background-color: #f9f9f9;
|
background-color: #f9f9f9;
|
||||||
box-shadow: 0 1px 2px rgba(0,0,0,0.125);
|
box-shadow: 0 1px 2px rgba(0,0,0,.125);
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
color: #2973b7;
|
color: #2973b7;
|
||||||
}
|
}
|
||||||
@ -106,7 +106,7 @@ pre, code {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pre code {
|
pre code {
|
||||||
font-size: 0.8em;
|
font-size: .8em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.attr {
|
.attr {
|
||||||
@ -119,7 +119,7 @@ pre code {
|
|||||||
|
|
||||||
footer {
|
footer {
|
||||||
margin: 5em 0 3em;
|
margin: 5em 0 3em;
|
||||||
font-size: 0.5em;
|
font-size: .5em;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,6 +147,15 @@ button {
|
|||||||
transition: opacity .3s;
|
transition: opacity .3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button:focus {
|
||||||
|
outline: none;
|
||||||
|
box-shadow: 0 0 1px #4fc08d;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:active {
|
||||||
|
background: rgba(79, 192, 141, .2);
|
||||||
|
}
|
||||||
|
|
||||||
button[disabled] {
|
button[disabled] {
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
@ -248,11 +257,11 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// simulating async data from server
|
// simulating async data from server
|
||||||
this.seconds = 3;
|
this.seconds = 3
|
||||||
let timer = setInterval(() => {
|
let timer = setInterval(() => {
|
||||||
this.seconds--;
|
this.seconds--
|
||||||
if (this.seconds === 0) {
|
if (this.seconds === 0) {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer)
|
||||||
this.$refs.bar.mergeOptions({
|
this.$refs.bar.mergeOptions({
|
||||||
xAxis: {
|
xAxis: {
|
||||||
data: asyncData.categories
|
data: asyncData.categories
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,18 +0,0 @@
|
|||||||
export default {
|
|
||||||
title: {
|
|
||||||
text: '计数器'
|
|
||||||
},
|
|
||||||
tooltip: {},
|
|
||||||
legend: {
|
|
||||||
data:['数量']
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
data: ['数量']
|
|
||||||
},
|
|
||||||
yAxis: {},
|
|
||||||
series: [{
|
|
||||||
name: '数量',
|
|
||||||
type: 'bar',
|
|
||||||
data: [0]
|
|
||||||
}]
|
|
||||||
}
|
|
Reference in New Issue
Block a user