推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
jjfat

使用 chart.js 创建的动画效果饼图效果,支持手机哈~

  •  
  •   jjfat · Jul 21, 2015 · 6147 views
    This topic created in 3959 days ago, the information mentioned may be changed or developed.

    chart.js类库可以帮助快速生成各种动态图形, 使用简单易用,以下代码可以生成相关饼图:

    var pieData = [
    {
    value: 300,
    color:"#F7464A",
    highlight: "#FF5A5E",
    label: "Red"
    },
    {
    value: 50,
    color: "#46BFBD",
    highlight: "#5AD3D1",
    label: "Green"
    },
    {
    value: 100,
    color: "#FDB45C",
    highlight: "#FFC870",
    label: "Yellow"
    },
    {
    value: 40,
    color: "#949FB1",
    highlight: "#A8B3C5",
    label: "Grey"
    },
    {
    value: 120,
    color: "#4D5360",
    highlight: "#616774",
    label: "Dark Grey"
    }

    ];
    

    window.onload = function(){
    var ctx = document.getElementById("chart-area").getContext("2d");
    window.myPie = new Chart(ctx).Pie(pieData);
    };

    在线代码调试运行地址: http://dwz.cn/chartjs

    扫扫二维码,手机上查看效果:

    6 replies    2015-08-02 11:12:58 +08:00
    miyuki
        1
    miyuki  
       Jul 21, 2015
    tao1991123
        2
    tao1991123  
       Jul 21, 2015
    话说百度的 echarts项目更好用
    iyaozhen
        3
    iyaozhen  
       Jul 21, 2015
    前排安利 echarts
    lincanbin
        4
    lincanbin  
       Jul 21, 2015
    百度的Echarts非常好用,前几天才用过,特别爽
    http://www.94cb.com/statistics
    mengzhuo
        5
    mengzhuo  
       Jul 21, 2015
    都没听说过d3js?
    SilentDepth
        6
    SilentDepth  
       Aug 2, 2015
    强迫症表示浅灰色角探出去的那个尖儿让人担忧……
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   845 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 21:34 · PVG 05:34 · LAX 14:34 · JFK 17:34
    ♥ Do have faith in what you're doing.