0

JQWidget円グラフを使用しようとしています。最初の例はテキスト ファイルにありますが、チャートで独自の値を使用したいと考えています。円グラフを作成するために合計 100 になる 4 つのセクション (A、B、C、不明) があります。

カテゴリ A の値は APercent です

カテゴリ B の値は BPercent です

カテゴリ C の値は CPercent です

カテゴリ不明の値は UKPercent です

すべての値を円グラフに追加しようとして立ち往生しています。現在、私のグラフは 4 つの凡例を読み込みますが、名前はなく、カテゴリの 1 つだけを読み込みます。

ここに画像の説明を入力

 var bigPie = [];


       bigPie.push({
         A: APercent
        });
       bigPie.push({
         B: BPercent
        });
       bigPie.push({
         C: CPercent
        });
       bigPie.push({
         Unknown: UKPercent
        });





$(document).ready(function () {

 // prepare chart data as an array
          // prepare jqxChart settings
            var settings = {
                title: "Information",
                description: "Legs",
                enableAnimations: true,
                showLegend: true,
                showBorderLine: true,
                legendLayout: { left: 700, top: 160, width: 300, height: 200, flow: 'vertical' },
                padding: { left: 5, top: 5, right: 5, bottom: 5 },
                titlePadding: { left: 0, top: 0, right: 0, bottom: 10 },
                source: bigPie,

                colorScheme: 'scheme03',
                seriesGroups:
                    [
                        {
                            type: 'pie',
                            showLabels: true,
                            series:
                                [
                                    {
                                        dataField: ‘A',
                                        displayText: ‘%',
                                        labelRadius: 170,
                                        initialAngle: 15,
                                        radius: 145,
                                        centerOffset: 0,
                                        formatFunction: function (value) {
                                            if (isNaN(value))
                                                return value;
                                            return parseFloat(value) + '%';
                                        },
                                    }
                                ]
                        }
                    ]
            };

ヘルプや提案をいただければ幸いです。前もって感謝します。何かについて明確でない、または漠然としている場合は、お知らせください。ありがとうございました!

4

1 に答える 1