1.0.3 • Published 9 years ago
riot-echarts v1.0.3
riot-echarts
a no-brainer riot tag to display charts easily with Baidu ECharts, like Google Chart does.

usage
import ECharts or use CDN
https://cdn.bootcss.com/echarts/3.3.2/echarts.min.jsinstall riot-echarts
npm install riot-echarts --saveimport riot-echarts
import 'riot-echarts'<app>
    <p>chart</p>
    <echart simple="{ option }"></echart>
    <script>
        this.option = {type:'pie',
            data: [
                ['name', 'value'],
                ['a', 10],
                ['b', 20],
                ['c', 25],
                ['d', 15],
                ['e', 55]
            ]
        }
    </script>
    <style>
        echart {
            display:block;
            width: 100%;
            height: 500px;
        }
    </style>
</app>Note: the container of charts must have a fixed height and width before chart rendering.
For more information, see example.
License
MIT