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');
                            }
                       
                        });
                  }
                })
  • 相关阅读:
    毒丸模式【其他模式】
    对象池模式【其他模式】
    双重校验锁模式【其他模式】
    回调模式【其他模式】
    命令模式【行为模式】
    备忘录模式【行为模式】
    Linux
    Cassandra Package installation directories
    cqlsh script
    Spring boot cassandra
  • 原文地址:https://www.cnblogs.com/8090sns/p/2835227.html
Copyright © 2011-2022 走看看