Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ioneday/wxchart
微信小程序,图表组件(柱状图、折线图、饼图、雷达图...)。持续更新中...
https://github.com/ioneday/wxchart
chart wechat
Last synced: 2 months ago
JSON representation
微信小程序,图表组件(柱状图、折线图、饼图、雷达图...)。持续更新中...
- Host: GitHub
- URL: https://github.com/ioneday/wxchart
- Owner: ioneday
- License: mit
- Created: 2017-06-15T13:22:19.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-16T09:54:55.000Z (over 7 years ago)
- Last Synced: 2024-08-03T09:09:44.015Z (6 months ago)
- Topics: chart, wechat
- Language: JavaScript
- Size: 108 KB
- Stars: 92
- Watchers: 4
- Forks: 32
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-star - wxchart
README
# wxchart
微信小程序,图表组件(柱状图、折线图、饼图、雷达图...)。持续更新中...![barchart](https://github.com/ioneday/wxchart/blob/master/image/barchart.png)![linechart](https://github.com/ioneday/wxchart/blob/master/image/line.png)![linechart](https://github.com/ioneday/wxchart/blob/master/image/barline.png)![linechart](https://github.com/ioneday/wxchart/blob/master/image/pie.png)
### Useage
wxml:
```javascript
//自适应屏幕宽度```
js:
```javascript
var chart = require("../../utils/chart.js");chart.draw(this, 'canvasId', {
hideYaxis: false,
color: ['#394655', '#74DAE5', '#ED7672', '#F3AA59', '#FEE746'],
title: {
text: "2017城市人均收入(万)",
color: "#333333",
size: 16
},
xAxis: {
color: "#666A73",
size: 10,
data: ['北京', '上海', '杭州', '深圳', '广州', '成都', '南京', '西安']
},
series: [
{
name: "第一季度",
category: "bar", //切换柱状图或折线图
data: [37, 63, 60, 78, 92, 63, 57, 48]
},
{
name: "第二季度",
category: "line",
data: [20, 35, 38, 59, 48, 27, 43, 35]
},
{
name: ['北京', '上海', '杭州', '深圳', '广州', '成都'],
category: "pie",//饼图不能与以上类型(bar、line)同时绘制
data: [40, 38, 39, 28, 27, 33]
}
]
});
```