zoukankan      html  css  js  c++  java
  • HighCharts中的饼状图

    $(function () {
        var chart;
        
        $(document).ready(function () {
            
            // Build the chart
            $('#container').highcharts({
                chart: {
                    plotBackgroundColor: null,
                    plotBorderWidth: null,
                    plotShadow: false
                },
                title: {
                    text: 'Browser market shares at a specific website, 2010'
                },
                tooltip: {
                    pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
                },
                plotOptions: {
                     pie: {  
                        
                        borderWidth: 0,  
                        allowPointSelect: true,  
                        cursor: 'pointer',  
                        dataLabels: {  
                        enabled: true,  
                        color: '#000',                        
                        distance: -10,//通过设置这个属性,将每个小饼图的显示名称和每个饼图重叠  
                        style: {                              
                            fontSize: '15px',  
                            lineHeight: '15px'  
                        },  
                        formatter: function(index) {      
                                return  this.point.percentage +'%';  
                           }  
                      },  
                    
                        showInLegend: true
                    }
                    
                },
                series: [{
                    type: 'pie',
                    name: 'Browser share',
                    data: [
                        ['Firefox',   45.0],
                        ['IE',       26.8],
                        {
                            name: 'Chrome',
                            y: 12.8,
                            sliced: true,
                            selected: true
                        },
                        ['Safari',    8.5],
                        ['Opera',     6.2],
                        ['Others',   0.7],
                        
                    ]
                }]
            });
        });
        
    });               

  • 相关阅读:
    错误总结Mapper扫描不到
    Spring项目出现--Error:java: Compilation failed: internal java compiler error
    mybatis-plus自动填充时间
    自定义异常类
    Swagger配置类
    JwtUtils工具类
    MD5加密工具类
    SpringBoot通用返回JSON数据封装类
    使用Swagger测试使传入json数据时出现JSON parse error: Unexpected character (‘}‘ (code 125)): was expecting double
    org.springframework.context.ApplicationContextException: Unable to start web server; nested exceptio
  • 原文地址:https://www.cnblogs.com/forthelichking/p/4360104.html
Copyright © 2011-2022 走看看