Giter Site home page Giter Site logo

wxchart's Introduction

wxchart

微信小程序,图表组件(柱状图、折线图、饼图、雷达图...)。持续更新中...

barchartlinechartlinechartlinechart

Useage

wxml:

//自适应屏幕宽度
<canvas style="width:{{chartWidth}}px;height:{{chartHeight}}px;"/>

js:

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]
        }
  ]
});

wxchart's People

Contributors

ioneday avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.