From ec7312cb64af8d93f56017289ab18a8badfd3bd2 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Sat, 9 Sep 2017 18:26:01 +0900 Subject: [PATCH] Use constants instead of hardcoded values --- samples/33_Chart_create_area.php | 14 +++++------ samples/33_Chart_create_bar_stacked.php | 14 +++++------ samples/33_Chart_create_column.php | 14 +++++------ samples/33_Chart_create_column_2.php | 14 +++++------ samples/33_Chart_create_composite.php | 14 +++++------ samples/33_Chart_create_line.php | 14 +++++------ samples/33_Chart_create_multiple_charts.php | 28 ++++++++++----------- samples/33_Chart_create_pie.php | 12 ++++----- samples/33_Chart_create_radar.php | 12 ++++----- samples/33_Chart_create_scatter.php | 14 +++++------ samples/33_Chart_create_stock.php | 18 ++++++------- samples/templates/chartSpreadsheet.php | 14 +++++------ 12 files changed, 91 insertions(+), 91 deletions(-) diff --git a/samples/33_Chart_create_area.php b/samples/33_Chart_create_area.php index 76a9f478..2fba7ca7 100644 --- a/samples/33_Chart_create_area.php +++ b/samples/33_Chart_create_area.php @@ -31,9 +31,9 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -43,7 +43,7 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -53,9 +53,9 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries diff --git a/samples/33_Chart_create_bar_stacked.php b/samples/33_Chart_create_bar_stacked.php index af9fb542..86178d79 100644 --- a/samples/33_Chart_create_bar_stacked.php +++ b/samples/33_Chart_create_bar_stacked.php @@ -31,9 +31,9 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -43,7 +43,7 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -53,9 +53,9 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries diff --git a/samples/33_Chart_create_column.php b/samples/33_Chart_create_column.php index 12903ea6..49d65c75 100644 --- a/samples/33_Chart_create_column.php +++ b/samples/33_Chart_create_column.php @@ -31,9 +31,9 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -43,7 +43,7 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -53,9 +53,9 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries diff --git a/samples/33_Chart_create_column_2.php b/samples/33_Chart_create_column_2.php index 8ea8d791..f4afcedb 100644 --- a/samples/33_Chart_create_column_2.php +++ b/samples/33_Chart_create_column_2.php @@ -39,9 +39,9 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 'Budget' - new DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 'Forecast' - new DataSeriesValues('String', 'Worksheet!$E$1', null, 1), // 'Actual' + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 'Budget' + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 'Forecast' + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$E$1', null, 1), // 'Actual' ]; // Set the X-Axis Labels // Datatype @@ -51,7 +51,7 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new DataSeriesValues('String', 'Worksheet!$A$2:$B$13', null, 12), // Q1 to Q4 for 2010 to 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$B$13', null, 12), // Q1 to Q4 for 2010 to 2012 ]; // Set the Data values for each data series we want to plot // Datatype @@ -61,9 +61,9 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new DataSeriesValues('Number', 'Worksheet!$C$2:$C$13', null, 12), - new DataSeriesValues('Number', 'Worksheet!$D$2:$D$13', null, 12), - new DataSeriesValues('Number', 'Worksheet!$E$2:$E$13', null, 12), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$13', null, 12), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$13', null, 12), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$E$2:$E$13', null, 12), ]; // Build the dataseries diff --git a/samples/33_Chart_create_composite.php b/samples/33_Chart_create_composite.php index d050a3e9..692209f8 100644 --- a/samples/33_Chart_create_composite.php +++ b/samples/33_Chart_create_composite.php @@ -39,13 +39,13 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels1 = [ - new DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // Temperature + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // Temperature ]; $dataSeriesLabels2 = [ - new DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // Rainfall + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // Rainfall ]; $dataSeriesLabels3 = [ - new DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // Humidity + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // Humidity ]; // Set the X-Axis Labels @@ -56,7 +56,7 @@ $dataSeriesLabels3 = [ // Data values // Data Marker $xAxisTickValues = [ - new DataSeriesValues('String', 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec ]; // Set the Data values for each data series we want to plot @@ -67,7 +67,7 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues1 = [ - new DataSeriesValues('Number', 'Worksheet!$B$2:$B$13', null, 12), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$13', null, 12), ]; // Build the dataseries @@ -91,7 +91,7 @@ $series1->setPlotDirection(DataSeries::DIRECTION_COL); // Data values // Data Marker $dataSeriesValues2 = [ - new DataSeriesValues('Number', 'Worksheet!$C$2:$C$13', null, 12), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$13', null, 12), ]; // Build the dataseries @@ -112,7 +112,7 @@ $series2 = new DataSeries( // Data values // Data Marker $dataSeriesValues3 = [ - new DataSeriesValues('Number', 'Worksheet!$D$2:$D$13', null, 12), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$13', null, 12), ]; // Build the dataseries diff --git a/samples/33_Chart_create_line.php b/samples/33_Chart_create_line.php index b2d6e4f3..0f1184f6 100644 --- a/samples/33_Chart_create_line.php +++ b/samples/33_Chart_create_line.php @@ -31,9 +31,9 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -43,7 +43,7 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -53,9 +53,9 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries diff --git a/samples/33_Chart_create_multiple_charts.php b/samples/33_Chart_create_multiple_charts.php index fe20b76d..bd2cf606 100644 --- a/samples/33_Chart_create_multiple_charts.php +++ b/samples/33_Chart_create_multiple_charts.php @@ -31,9 +31,9 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels1 = [ - new DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -43,7 +43,7 @@ $dataSeriesLabels1 = [ // Data values // Data Marker $xAxisTickValues1 = [ - new DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -53,9 +53,9 @@ $xAxisTickValues1 = [ // Data values // Data Marker $dataSeriesValues1 = [ - new DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries @@ -103,9 +103,9 @@ $worksheet->addChart($chart1); // Data values // Data Marker $dataSeriesLabels2 = [ - new DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -115,7 +115,7 @@ $dataSeriesLabels2 = [ // Data values // Data Marker $xAxisTickValues2 = [ - new DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -125,9 +125,9 @@ $xAxisTickValues2 = [ // Data values // Data Marker $dataSeriesValues2 = [ - new DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries diff --git a/samples/33_Chart_create_pie.php b/samples/33_Chart_create_pie.php index 895e0429..3b5ea810 100644 --- a/samples/33_Chart_create_pie.php +++ b/samples/33_Chart_create_pie.php @@ -31,7 +31,7 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels1 = [ - new DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 ]; // Set the X-Axis Labels // Datatype @@ -41,7 +41,7 @@ $dataSeriesLabels1 = [ // Data values // Data Marker $xAxisTickValues1 = [ - new DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -51,7 +51,7 @@ $xAxisTickValues1 = [ // Data values // Data Marker $dataSeriesValues1 = [ - new DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), ]; // Build the dataseries @@ -103,7 +103,7 @@ $worksheet->addChart($chart1); // Data values // Data Marker $dataSeriesLabels2 = [ - new DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 ]; // Set the X-Axis Labels // Datatype @@ -113,7 +113,7 @@ $dataSeriesLabels2 = [ // Data values // Data Marker $xAxisTickValues2 = [ - new DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -123,7 +123,7 @@ $xAxisTickValues2 = [ // Data values // Data Marker $dataSeriesValues2 = [ - new DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), ]; // Build the dataseries diff --git a/samples/33_Chart_create_radar.php b/samples/33_Chart_create_radar.php index df81f38c..49053c95 100644 --- a/samples/33_Chart_create_radar.php +++ b/samples/33_Chart_create_radar.php @@ -39,8 +39,8 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -50,8 +50,8 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new DataSeriesValues('String', 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec - new DataSeriesValues('String', 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec ]; // Set the Data values for each data series we want to plot // Datatype @@ -61,8 +61,8 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new DataSeriesValues('Number', 'Worksheet!$C$2:$C$13', null, 12), - new DataSeriesValues('Number', 'Worksheet!$D$2:$D$13', null, 12), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$13', null, 12), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$13', null, 12), ]; // Build the dataseries diff --git a/samples/33_Chart_create_scatter.php b/samples/33_Chart_create_scatter.php index df5564d7..f756c5a9 100644 --- a/samples/33_Chart_create_scatter.php +++ b/samples/33_Chart_create_scatter.php @@ -31,13 +31,13 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels $xAxisTickValues = [ - new DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -47,9 +47,9 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries diff --git a/samples/33_Chart_create_stock.php b/samples/33_Chart_create_stock.php index 78d16e3f..30c876b5 100644 --- a/samples/33_Chart_create_stock.php +++ b/samples/33_Chart_create_stock.php @@ -37,10 +37,10 @@ $worksheet->getStyle('B2:E6')->getNumberFormat()->setFormatCode(NumberFormat::FO // Data values // Data Marker $dataSeriesLabels = [ - new DataSeriesValues('String', 'Worksheet!$B$1', null, 1), //Max / Open - new DataSeriesValues('String', 'Worksheet!$C$1', null, 1), //Min / Close - new DataSeriesValues('String', 'Worksheet!$D$1', null, 1), //Min Threshold / Min - new DataSeriesValues('String', 'Worksheet!$E$1', null, 1), //Max Threshold / Max + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), //Max / Open + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), //Min / Close + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), //Min Threshold / Min + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$E$1', null, 1), //Max Threshold / Max ]; // Set the X-Axis Labels // Datatype @@ -50,7 +50,7 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new DataSeriesValues('String', 'Worksheet!$A$2:$A$6', null, 5), // Counts + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$6', null, 5), // Counts ]; // Set the Data values for each data series we want to plot // Datatype @@ -60,10 +60,10 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new DataSeriesValues('Number', 'Worksheet!$B$2:$B$6', null, 5), - new DataSeriesValues('Number', 'Worksheet!$C$2:$C$6', null, 5), - new DataSeriesValues('Number', 'Worksheet!$D$2:$D$6', null, 5), - new DataSeriesValues('Number', 'Worksheet!$E$2:$E$6', null, 5), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$6', null, 5), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$6', null, 5), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$6', null, 5), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$E$2:$E$6', null, 5), ]; // Build the dataseries diff --git a/samples/templates/chartSpreadsheet.php b/samples/templates/chartSpreadsheet.php index c462f533..7406e4be 100644 --- a/samples/templates/chartSpreadsheet.php +++ b/samples/templates/chartSpreadsheet.php @@ -28,9 +28,9 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$B$1', null, 1), // 2010 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$C$1', null, 1), // 2011 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -40,7 +40,7 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -50,9 +50,9 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$B$2:$B$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$C$2:$C$5', null, 4), + new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries