我想創建一個堆疊的條形圖,如下圖所示嵌入PowerPoint模板的幻燈片中。當我在下面運行我的腳本時,出現錯誤。openTBS/PHP - 如何創建堆疊條形圖?
TinyButStrong錯誤OpenTBS插件:(ChartChangeSeries) 'chart3': 無法發現在圖表 'chart3' 系列的系列3'。 過程正在結束,除非您將NoErr屬性設置爲true。
就我所見,我的系列清晰地與x軸的兩個標籤一起定義。
我在哪裏出錯了,我該如何解決這個錯誤?
$ecdClosureStatus = getClosureChartData('ECD');
$ChartNameOrNum = 'chart3'; // Title of the shape that embeds the chart
$ChartRef = 'chart3'; // Title of the shape that embeds the chart
$SeriesNameOrNum = 'Series 1';
$NewLegend = "Closed On Time";
$NewValues = array(
(int)$ecdClosureStatus['ClosedOnTime'],
0
);
$TBS->PlugIn(OPENTBS_CHART, $ChartNameOrNum, $SeriesNameOrNum, $NewValues, $NewLegend);
$SeriesNameOrNum = 'Series 2';
$NewLegend = 'Closed 1-30 Days Late';
$NewValues = array(
0,
(int)$ecdClosureStatus['OneToThirtyDaysLate']
);
$TBS->PlugIn(OPENTBS_CHART, $ChartNameOrNum, $SeriesNameOrNum, $NewValues, $NewLegend);
$SeriesNameOrNum = 'Series 3';
$NewLegend = 'Closed 31-60 Days Late';
$NewValues = array(
0,
(int)$ecdClosureStatus['ThirtyOneToSixtyDaysLate']
);
$TBS->PlugIn(OPENTBS_CHART, $ChartNameOrNum, $SeriesNameOrNum, $NewValues, $NewLegend);
$SeriesNameOrNum = 'Series 4';
$NewLegend = 'Closed 61-90 Days Late';
$NewValues = array(
0,
(int)$ecdClosureStatus['SixtyOneToNinetyDaysLate']
);
$TBS->PlugIn(OPENTBS_CHART, $ChartNameOrNum, $SeriesNameOrNum, $NewValues, $NewLegend);
$SeriesNameOrNum = 'Series 5';
$NewLegend = 'Closed >90 Days Late';
$NewValues = array(
0,
(int)$ecdClosureStatus['ClosedMoreThanNinetyDaysLate']
);
$TBS->PlugIn(OPENTBS_CHART, $ChartNameOrNum, $SeriesNameOrNum, $NewValues, $NewLegend);
謝謝您的回覆。在我的$ ecdClosureStatus數組中,我發現我的某個鍵的名稱不正確。更改數組鍵名後,我修改了我的代碼並獲得了結果。我將發佈解決方案的代碼。 – Vahe