• Stars
    star
    202
  • Rank 193,691 (Top 4 %)
  • Language
    JavaScript
  • Created about 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🏹微信小程序图表charts组件

wxapp-charts

微信小程序图表charts组件

Usage

        data: {
                charts: {
                    area: ["上海,750","杭州,425","苏州,960","南京,700","广州,800","厦门,975","北京,375","沈阳,775","泉州,100","哈尔滨,200"],
                    pieData: [10, 25, 35, 30]
                }
            }

            //饼图    
        new Charts({
            type: "pie",
            data: this.data.charts.pieData,
            colors: ["#7158ec", "#fec312", "#1db2f4", "#ff3444"],
            canvasId: 'canvas1',
            point: {
                x: 150,
                y: 150
            },
            radius : 100
        });
        //圆环图
        new Charts({
            type: "ring",
            data: [10, 25, 35, 30],
            colors: ["#7158ec", "#fec312", "#1db2f4", "#ff3444"],
            canvasId: 'canvas2',
            point: {
                x: 150,
                y: 150
            },
            radius : 100
        });

        //柱状图
        new Charts({
            type: 'bar',
            data: this.data.charts.area,
            bgColors: "#46a2ef",
            color: '#383838',
            cHeight: 300,//表格高度
            cWidth: 500,//表格宽度
            bWidth: 22,//柱子宽度
            bMargin: 16,//柱子间距
            showYAxis: false,//是否显示Y轴
            xCaption: 'x轴说明文字',
            yCaption: 'y轴说明文字',
            canvasId: 'chartContainer'
         });

参数说明

    type: -支持pie,ring,bar
    data: []
    colors: []颜色
    canvasId: canvas-id
    point:x轴圆心坐标,y轴圆心坐标
    radius:半径大小
    xCaption: 水平坐标说明文字
    yCaption: 纵坐标说明文字
    showYAxis:是否显示y轴

更新说明

  • 增加data对外接口
  • 添加部分API,如cWidth等

效果如图所示

手机端效果

More Repositories

1

github-FE-project

A collection about github front-end project
1,061
star
2

tech-blog

📦My personal tech blog,not regularly update
337
star
3

judge

🎿A lightweight vanilla JavaScript library for judging
TypeScript
76
star
4

resume-master

A resume generator that read from json data and generate static pages
CSS
76
star
5

hbuild

⚔repaid build web/vue/react project starter kit with cli
JavaScript
38
star
6

vue-waimai

基于vue2+vue-router+axios+webpack+es6+less开发的仿美团外卖项目
Vue
30
star
7

hooks-view-model

🧜🏽‍♀️ a solution that make react hooks support mvvm and aims to separates UI from business logic and provide immutable data & global state management, memory management and persistent data management and providing intuitive API
TypeScript
22
star
8

mock-stores

🍡yet another easy and delightful data mock solutions
JavaScript
11
star
9

Novajs

lightweight js framework,handle dom element and cross browser event
JavaScript
9
star
10

front-end-utils

front end demos
JavaScript
7
star
11

learning-js-well

what I learn & think about js
JavaScript
5
star
12

javascript-design-pattern

javascript design pattern that used in daily working
TypeScript
5
star
13

hawx1993.github.io

hawx1993.github.io
HTML
5
star
14

javascript-algorithm

JavaScript common algorithm that used in daily working
TypeScript
4
star
15

2048

2048games
CSS
4
star
16

use-better-state

better react useState, and simplify state writing, provide global state management, and provide immer fine-grained updates
TypeScript
4
star
17

hbuild-cli

🎸a cli tool for hbuild project
JavaScript
3
star
18

react-webpack-es6-demos

react-webpack-es6 demos
JavaScript
2
star
19

node-blog

simple node blog
JavaScript
2
star
20

webpack-logplugin

A webpack plugin for logging info after compilation is done.
JavaScript
2
star
21

lazy-import-with-error-boundary

react hooks component lazy import with Error Boundary
TypeScript
2
star
22

vkit

一套常用的移动端基础样式库
JavaScript
2
star
23

react-mobx-viewmodel

A react ViewModel binding container that used by mobx and ts
1
star
24

antd-editable-tree

基于antd tree组件开发的可编辑树组件
TypeScript
1
star
25

resume

my personal resume
1
star
26

base2

Automatically exported from code.google.com/p/base2
JavaScript
1
star
27

hawx1993

about hawx1993
1
star
28

head-first-webpack-handbook

webpack 深入浅出 gitbook
CSS
1
star
29

vscode-antd-helper

a vscode plugin for antd react and antd vue code helper
TypeScript
1
star
30

heaven-docs

heaven-docs
1
star
31

react-hooks-mvvm

A way to split react UI and logic, based react hooks
TypeScript
1
star