simple svg charts with zero dependencies more examples, more png
-
Install via
npm
:$ npm install s-chart
and include in your project:
import Chart from "s-chart"
-
...or include within your HTML
<script src="./schart.js"></script>
const data0 = [
{
label: '实例1',
value: 234
},
{
label: '实例2',
value: 100
},
{
label: '实例3',
value: 500
},
{
label: '实例4',
value: 400
}
]
const pieChart = new Chart({
id: 'pie-chart',
title: 'Pie Chart',
data: data0,
type: 'pie', // or 'line', 'scatter', 'pie', 'percentage', 'scatter'
height: 250,
width: 640,
sortDataType: 'descending', // ascending descending none
})
View Examples:
- Clone this repo.
cd
into project directory.npm install -g parcel
npm run example
If you want to contribute:
- Clone this repo.
cd
into project directorynpm install
npm run build
- The very first version out, with pie, percentage, bars, lines and scatter.
This repository has been released under the MIT License
Project maintained by facejiong