zoukankan      html  css  js  c++  java
  • FusionCharts 更新 chart data 数据

    var AlarmChart = null;
    
    function alarmChartReBuild(totalNum, alarmNum) {
    
        var alarmPart = (alarmNum * 100.0) / (totalNum * 1.0);
        
        var isSliced = 1;
        if (alarmPart == 0) {
            isSliced = 0;
        }
        
        var chartdata = alarmChartBuild(100 - alarmPart, alarmPart, isSliced);
        
        AlarmChart.setChartData(chartdata, "json");
    }
    
    function init_AlarmChart() {
        var chartdata = alarmChartBuild(100, 0, 0);
        
        FusionCharts.ready(function() {
            AlarmChart = new FusionCharts({
              type: "doughnut3d",
              renderAt: "chart-container",
               "100%",
              height: "100%",
              dataFormat: "json",
              dataSource: chartdata
           });
           //AlarmChart.setTransparent();//背景透明   设置上这个
           AlarmChart.render();
        });
    }
    
    function alarmChartBuild(normalPart, alarmPart, isSliced) {
    
        return {
            "chart": {
                "caption": "综合运行率",
                "numberPrefix": "%",
                //"bgAlpha": "0,0",
                //"canvasBgAlpha": "0",
                "skipOverlapLabels": "0",
                "startingAngle": "15",
                "showLegend": "1",
                "defaultCenterLabel": "Total revenue: $64.08K",
                "centerLabel": "Revenue from $label: $value",
                "centerLabelBold": "1",
                "showTooltip": "0",
                "decimals": "0",
                "paletteColors": "#1aaf5d,#f45b00,#0075c2,#f2c500,#8e0000",
                "theme": "fusion"
            },
            "data": [{
                "label": "正常",
                "value": normalPart
            }, {
                "label": "异常",
                "isSliced": isSliced,
                "value": alarmPart
            }]
        };
    
    }

    两个好用的网址:

    FusionCharts使用教程:Fusioncharts API参考方法(Functions)总结

    https://www.ev我的get.com/article/2014/5/9/20959.html

    FusionCharts的使用方法(超详细)

    http://www.cnblogs.com/aspphp/p/6209286.html

  • 相关阅读:
    使用外部属性文件
    Bean的作用域
    Bean之间的关系
    Spring MVC--第一个程序
    Spring MVC 概述
    Spring Tool Suite 安装
    自动装配
    6)HTML中a链接跳转地址怎么写
    PHP小点注意
    5)关于CSS和js静态文件引入路径
  • 原文地址:https://www.cnblogs.com/LcxSummer/p/10268443.html
Copyright © 2011-2022 走看看