docsify-echarts-plugin
v0.0.3docsify-echarts-plugin
support to use echarts in docsify.
install
<script>
window.$docsify = {
name: 'docsify-echarts-plugin',
repo: 'https://github.com/xiguaxigua/docsify-echarts-plugin',
loadSidebar: 'summary.md'
}
</script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/echarts@latest/dist/echarts.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify-echarts-plugin/lib/index.min.js"></script>
start
```chart
{
xAxis : [
{
type : 'category',
data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
}
],
yAxis : [{ type : 'value' }],
series : [
{
name:'直接访问',
type:'bar',
barWidth: '60%',
data:[10, 52, 200, 334, 390, 330, 220]
}
]
}
```
set container
```chart
{
settings: {
width: '50%',
height: '300px',
border: '1px solid red'
},
xAxis : [
{
type : 'category',
data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
}
],
yAxis : [{ type : 'value' }],
series : [
{
name:'直接访问',
type:'bar',
barWidth: '60%',
data:[10, 52, 200, 334, 390, 330, 220]
}
]
}
```
set events
```chart
{
settings: {
events: {
click (e) {
console.log(e)
}
}
},
xAxis : [
{
type : 'category',
data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
}
],
yAxis : [{ type : 'value' }],
series : [
{
name:'直接访问',
type:'bar',
barWidth: '60%',
data:[10, 52, 200, 334, 390, 330, 220]
}
]
}
```
set theme
```chart
{
settings: {
theme: {
categoryAxis: {
axisLine: { show: false },
axisTick: { show: false },
splitLine: { show: false }
},
valueAxis: { axisLine: { show: false } }
}
},
xAxis : [
{
type : 'category',
data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
}
],
yAxis : [{ type : 'value' }],
series : [
{
name:'直接访问',
type:'bar',
barWidth: '60%',
data:[10, 52, 200, 334, 390, 330, 220]
}
]
}
```
or set global theme
window.$docsify = {
name: 'docsify-echarts-plugin',
repo: 'https://github.com/xiguaxigua/docsify-echarts-plugin',
loadSidebar: 'summary.md',
echartsTheme: {
categoryAxis: {
axisLine: { show: false },
axisTick: { show: false },
splitLine: { show: false }
},
valueAxis: { axisLine: { show: false } }
}
}
npm i docsify-echarts-plugin
Metadata
- ISC
- Whatever
- Unknown
- released 12/15/2017