1

フィドルを使用すると、データポイントのmouseOverにツールチップが表示されるだけでなく、LegendItemをクリックしたときのクリックイベントやパイスライスのポップアウト効果も表示されるhighCharts Pie Chartがありますが、コードをプラグインすると私のサイトでは、どのバージョンの IE または google chrome でも動作しません。私は契約が何であるかを知りません。ここではツールチップとクリックイベントが機能していますが、私のコードではどれも機能しません。

http://jsfiddle.net/hAnCr/

$("document").ready(
function(){
$('#container').highcharts({
        chart:{
            type:'pie',
            height: 250,
            width: 350
              },
        colors:[
            '#5485BC', '#AA8C30', '#5C9384', '#981A37', '#FCB319',     '#86A033', '#614931', '#00526F', '#594266', '#cb6828', '#aaaaab', '#a89375'
            ],
        title:{text: null},
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                showInLegend: true,
                dataLabels: {
                    enabled: false,                        
                    formatter: function() {
                        return this.percentage.toFixed(2) + '%';
                    }
                },                                  
            }
        },
        legend: {
            enabled: true,
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle'
        },
        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]
            ]
        }]
    });
});

私が持っていた 2 番目の質問は、データ内で switch ステートメントを実行し、基本的に 1 つのパラメーターを渡す関数を作成し、パラメーター値に応じて data[] 値を変更できるかどうかでした。

助けてくれてありがとう、NickG

4

0 に答える 0