1

基本的に私がやりたいことは、レジェンドでデータ名と値を使用することですが、データ名が左に配置され、データ値がこのように右に配置されるように間隔を空けて配置します。

Name1           Val1
Name2           Val2

など。現在、デフォルトは

Name1 Val1
Name2 Val2

その間にスペースを入れて設定しましたが、名前1が10文字で名前2が8文字の場合、このようにずれています。

Name1isthis Val1
Name2lookslikethis Val2

どんな助けでも大歓迎です。これがコードと私のフィドルです。http://jsfiddle.net/hAnCr/1/

$("document").ready(
function(){
$('#container').highcharts({
        chart:{type:'pie'},
        credits:{enabled: false},
        colors:[
            '#5485BC', '#AA8C30', '#5C9384', '#981A37', '#FCB319',     '#86A033', '#614931', '#00526F', '#594266', '#cb6828', '#aaaaab', '#a89375'
            ],
        title:{text: null},
         tooltip: {
            pointFormat: '<b>{point.y}%</b>',
            percentageDecimals: 1
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,                 
                cursor: 'pointer',
                showInLegend: true,
                dataLabels: {
                    enabled: false                       
                }                                   
            }
        },
        legend: {
            enabled: true,
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            labelFormatter: function() {
                return this.name + ' ' + this.y + '%';
            }
        },
        series: [{
            type: 'pie',
            dataLabels:{

            },
            data: [
                ['Domestic Equity', 38.5],
                ['International Equity', 26.85],
                ['Other', 15.70],
                ['Cash and Equivalents', 10.48],
                ['Fixed Income', 8.48]
            ]
        }]
    });
});
4

0 に答える 0