zoukankan      html  css  js  c++  java
  • JS图表

    http://www.cnblogs.com/java-pan/archive/2011/12/31/highcharts.html

    另MVC3下:

    View Code
     /***************************************************************/
    
                    $(".validatebox-text").val()  //取多选下拉框的值
                    $("#Foot").css("display", ""); //将分页的控件显示出来
                    $("#pp").show();
                    $("#container").css("background-color", "#F3F7FB");
                    $("#container2").css("background-color", "#F3F7FB");
                    $("#container3").css("background-color", "#F3F7FB");
                    $("#container4").css("background-color", "#F3F7FB");
    
                    var chart = new Highcharts.Chart({
                        chart: {
                            renderTo: 'container',
                            margin: [50, 100, 60, 100]
                        },
                        title: {
                            text:  strtitle + "- 0:00AM~6:00AM"
                        },
                        plotArea: {
                            shadow: null,
                            borderWidth: null,
                            backgroundColor: null
                        },
                        tooltip: {
                            formatter: function () {
                                return '<b>' + this.point.name + '</b>: ' + this.y + ''; //单位
                            }
                        },
                        plotOptions: {
                            pie: {
                                dataLabels: {
                                    enabled: true,
                                    formatter: function () {
                                         return this.point.name;
                                    },
                                    color: 'white',
                                    style: {
                                        font: '13px Trebuchet MS, Verdana, sans-serif'
                                    }
                                }
                            }
                        },
                        legend: {
                            layout: 'vertical',
                            style: {
                                left: 'auto',
                                bottom: 'auto',
                                right: '50px',
                                top: '100px'
                            }
                        },
                        series: [{
                            type: 'pie',
                            name: 'Browser share',
                            data: [{
                                name: '@ViewBag.Using',
                                y:parseInt(argarr[5]),
                                sliced: false
                            },
                            //                                        ['Using', 26],
                                            {
                                            name:  '@ViewBag.NoUse',
                                            y:parseInt(argarr[1]) -parseInt(argarr[5]),
                                            sliced: false
                            }
                                        ]
                            //data: [3.40, 1.05, 2.90, 1.65, 1.35, 2.59, 1.39, 3.07, 2.82]
                        }]
                    });
                    var chart2 = new Highcharts.Chart({
                        chart: {
                            renderTo: 'container2',
                            margin: [50, 100, 60, 100]
                        },
                        title: {
                            text:  strtitle + "- 6:00AM~12:00AM"
                        },
                        plotArea: {
                            shadow: null,
                            borderWidth: null,
                            backgroundColor: null
                        },
                        tooltip: {
                            formatter: function () {
                                return '<b>' + this.point.name + '</b>: ' + this.y +  ''; //单位
                            }
                        },
                        plotOptions: {
                            pie: {
                                dataLabels: {
                                    enabled: true,
                                    formatter: function () {
                                        return this.point.name; // if (this.y > 5) return this.point.name;
                                    },
                                    color: 'white',
                                    style: {
                                        font: '13px Trebuchet MS, Verdana, sans-serif'
                                    }
                                }
                            }
                        },
                        legend: {
                            layout: 'vertical',
                            style: {
                                left: 'auto',
                                bottom: 'auto',
                                right: '50px',
                                top: '100px'
                            }
                        },
                        series: [{
                            type: 'pie',
                            name: 'Browser share',
                            data: [{
                                name: '@ViewBag.Using',
                                y: parseInt(argarr[6]),
                                sliced: false
                            },
                            //                                        ['Using', 26],
                                            {
                                            name: '@ViewBag.NoUse',
                                            y: parseInt(argarr[2]) -parseInt(argarr[6]),
                                            sliced: false
                            }
                                        ]
                            //data: [3.40, 1.05, 2.90, 1.65, 1.35, 2.59, 1.39, 3.07, 2.82]
                        }]
                    });
                    var chart = new Highcharts.Chart({
                        chart: {
                            renderTo: 'container3',
                            margin: [50, 100, 60, 100]
                        },
                        title: {
                            text: strtitle + "- 12:00AM~18:00PM"
                        },
                        plotArea: {
                            shadow: null,
                            borderWidth: null,
                            backgroundColor: null
                        },
                        tooltip: {
                            formatter: function () {
                                return '<b>' + this.point.name + '</b>: ' + this.y +  ''; //单位
                            }
                        },
                        plotOptions: {
                            pie: {
                                dataLabels: {
                                    enabled: true,
                                    formatter: function () {
                                        return this.point.name;
                                    },
                                    color: 'white',
                                    style: {
                                        font: '13px Trebuchet MS, Verdana, sans-serif'
                                    }
                                }
                            }
                        },
                        legend: {
                            layout: 'vertical',
                            style: {
                                left: 'auto',
                                bottom: 'auto',
                                right: '50px',
                                top: '100px'
                            }
                        },
                        series: [{
                            type: 'pie',
                            name: 'Browser share',
                            data: [{
                                name:  '@ViewBag.Using',
                                y: parseInt(argarr[7]),
                                sliced: false
                            },
                                        
                                            {
                                                name:  '@ViewBag.NoUse',
                                                y: parseInt(argarr[3]) -parseInt(argarr[7]),
                                                sliced: false
                                            }
                                        ]
                            //data: [3.40, 1.05, 2.90, 1.65, 1.35, 2.59, 1.39, 3.07, 2.82]
                        }]
                    });
                    var chart = new Highcharts.Chart({
                        chart: {
                            renderTo: 'container4',
                            margin: [50, 100, 60, 100]
                        },
                        title: {
                            text: strtitle + "- 18:00PM~24:00PM"
                        },
                        plotArea: {
                            shadow: null,
                            borderWidth: null,
                            backgroundColor: null
                        },
                        tooltip: {
                            formatter: function () {
                                return '<b>' + this.point.name + '</b>: ' + this.y +  ''; //单位;
                            }
                        },
                        plotOptions: {
                            pie: {
                                dataLabels: {
                                    enabled: true,
                                    formatter: function () {
                                        return this.point.name;
                                    },
                                    color: 'white',
                                    style: {
                                        font: '13px Trebuchet MS, Verdana, sans-serif'
                                    }
                                }
                            }
                        },
                        legend: {
                            layout: 'vertical',
                            style: {
                                left: 'auto',
                                bottom: 'auto',
                                right: '50px',
                                top: '100px'
                            }
                        },
                        series: [{
                            type: 'pie',
                            name: 'Browser share',
                            data: [{
                                name:  '@ViewBag.Using',
                                y: parseInt(argarr[8]),
                                sliced: false
                            },
                                            
                                            {
                                                name: '@ViewBag.NoUse',
                                                y: parseInt(argarr[4]) -parseInt(argarr[8]),
                                                sliced: false
                                            }
                                        ]
                            //data: [3.40, 1.05, 2.90, 1.65, 1.35, 2.59, 1.39, 3.07, 2.82]
                        }]
                    });
            
    /***************************************************************/ 
                            }
                            else {
                                alert('@ViewBag.NoRecord');
                            }
                       
                        });
                  }
                })
  • 相关阅读:
    建立名称server
    crm操作货币实体
    JavaScript DOM对象和JQuery对象相互转换
    windows 下实现函数打桩:拦截API方式
    ios开发——仿新版iBooks书本打开与关闭动画
    [Hadoop大数据]——Hive数据的导入导出
    《Hive编程指南》—— 读后总结
    《鬼谷子的局6》—— 读后总结
    [Hadoop大数据]——Hive部署入门教程
    CentOS6.5下安装JDK
  • 原文地址:https://www.cnblogs.com/8090sns/p/2835227.html
Copyright © 2011-2022 走看看