Scrutinizer Complains Some Samples Class Name Conflict with Jpgraph (#2684)
Jpgraph does not use namespaces. Neither do the Samples members of this project. As a result, Scrutinizer complains about 13 cases of `use PhpOffice\PhpSpreadsheet\Chart\Legend;`, since this theoretically could cause the use of two different Legend classes in the empty namespace. It suggests using a class alias for Legend, which this PR does in every applicable case. It is a regrettable problem, but it is easy to fix.
This commit is contained in:
parent
f2f626e02c
commit
a8e179d5d9
|
|
@ -3,7 +3,7 @@
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Legend;
|
use PhpOffice\PhpSpreadsheet\Chart\Legend as ChartLegend;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
@ -71,7 +71,7 @@ $series = new DataSeries(
|
||||||
// Set the series in the plot area
|
// Set the series in the plot area
|
||||||
$plotArea = new PlotArea(null, [$series]);
|
$plotArea = new PlotArea(null, [$series]);
|
||||||
// Set the chart legend
|
// Set the chart legend
|
||||||
$legend = new Legend(Legend::POSITION_TOPRIGHT, null, false);
|
$legend = new ChartLegend(ChartLegend::POSITION_TOPRIGHT, null, false);
|
||||||
|
|
||||||
$title = new Title('Test %age-Stacked Area Chart');
|
$title = new Title('Test %age-Stacked Area Chart');
|
||||||
$yAxisLabel = new Title('Value ($k)');
|
$yAxisLabel = new Title('Value ($k)');
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Legend;
|
use PhpOffice\PhpSpreadsheet\Chart\Legend as ChartLegend;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
@ -74,7 +74,7 @@ $series->setPlotDirection(DataSeries::DIRECTION_BAR);
|
||||||
// Set the series in the plot area
|
// Set the series in the plot area
|
||||||
$plotArea = new PlotArea(null, [$series]);
|
$plotArea = new PlotArea(null, [$series]);
|
||||||
// Set the chart legend
|
// Set the chart legend
|
||||||
$legend = new Legend(Legend::POSITION_RIGHT, null, false);
|
$legend = new ChartLegend(ChartLegend::POSITION_RIGHT, null, false);
|
||||||
|
|
||||||
$title = new Title('Test Chart');
|
$title = new Title('Test Chart');
|
||||||
$yAxisLabel = new Title('Value ($k)');
|
$yAxisLabel = new Title('Value ($k)');
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Legend;
|
use PhpOffice\PhpSpreadsheet\Chart\Legend as ChartLegend;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
@ -74,7 +74,7 @@ $series->setPlotDirection(DataSeries::DIRECTION_COL);
|
||||||
// Set the series in the plot area
|
// Set the series in the plot area
|
||||||
$plotArea = new PlotArea(null, [$series]);
|
$plotArea = new PlotArea(null, [$series]);
|
||||||
// Set the chart legend
|
// Set the chart legend
|
||||||
$legend = new Legend(Legend::POSITION_RIGHT, null, false);
|
$legend = new ChartLegend(ChartLegend::POSITION_RIGHT, null, false);
|
||||||
|
|
||||||
$title = new Title('Test Column Chart');
|
$title = new Title('Test Column Chart');
|
||||||
$yAxisLabel = new Title('Value ($k)');
|
$yAxisLabel = new Title('Value ($k)');
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Legend;
|
use PhpOffice\PhpSpreadsheet\Chart\Legend as ChartLegend;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
@ -82,7 +82,7 @@ $series->setPlotDirection(DataSeries::DIRECTION_COL);
|
||||||
// Set the series in the plot area
|
// Set the series in the plot area
|
||||||
$plotArea = new PlotArea(null, [$series]);
|
$plotArea = new PlotArea(null, [$series]);
|
||||||
// Set the chart legend
|
// Set the chart legend
|
||||||
$legend = new Legend(Legend::POSITION_BOTTOM, null, false);
|
$legend = new ChartLegend(ChartLegend::POSITION_BOTTOM, null, false);
|
||||||
|
|
||||||
$title = new Title('Test Grouped Column Chart');
|
$title = new Title('Test Grouped Column Chart');
|
||||||
$xAxisLabel = new Title('Financial Period');
|
$xAxisLabel = new Title('Financial Period');
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Legend;
|
use PhpOffice\PhpSpreadsheet\Chart\Legend as ChartLegend;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
@ -128,7 +128,7 @@ $series3 = new DataSeries(
|
||||||
// Set the series in the plot area
|
// Set the series in the plot area
|
||||||
$plotArea = new PlotArea(null, [$series1, $series2, $series3]);
|
$plotArea = new PlotArea(null, [$series1, $series2, $series3]);
|
||||||
// Set the chart legend
|
// Set the chart legend
|
||||||
$legend = new Legend(Legend::POSITION_RIGHT, null, false);
|
$legend = new ChartLegend(ChartLegend::POSITION_RIGHT, null, false);
|
||||||
|
|
||||||
$title = new Title('Average Weather Chart for Crete');
|
$title = new Title('Average Weather Chart for Crete');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Legend;
|
use PhpOffice\PhpSpreadsheet\Chart\Legend as ChartLegend;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
@ -72,7 +72,7 @@ $series = new DataSeries(
|
||||||
// Set the series in the plot area
|
// Set the series in the plot area
|
||||||
$plotArea = new PlotArea(null, [$series]);
|
$plotArea = new PlotArea(null, [$series]);
|
||||||
// Set the chart legend
|
// Set the chart legend
|
||||||
$legend = new Legend(Legend::POSITION_TOPRIGHT, null, false);
|
$legend = new ChartLegend(ChartLegend::POSITION_TOPRIGHT, null, false);
|
||||||
|
|
||||||
$title = new Title('Test Stacked Line Chart');
|
$title = new Title('Test Stacked Line Chart');
|
||||||
$yAxisLabel = new Title('Value ($k)');
|
$yAxisLabel = new Title('Value ($k)');
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Legend;
|
use PhpOffice\PhpSpreadsheet\Chart\Legend as ChartLegend;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
@ -71,7 +71,7 @@ $series1 = new DataSeries(
|
||||||
// Set the series in the plot area
|
// Set the series in the plot area
|
||||||
$plotArea1 = new PlotArea(null, [$series1]);
|
$plotArea1 = new PlotArea(null, [$series1]);
|
||||||
// Set the chart legend
|
// Set the chart legend
|
||||||
$legend1 = new Legend(Legend::POSITION_TOPRIGHT, null, false);
|
$legend1 = new ChartLegend(ChartLegend::POSITION_TOPRIGHT, null, false);
|
||||||
|
|
||||||
$title1 = new Title('Test %age-Stacked Area Chart');
|
$title1 = new Title('Test %age-Stacked Area Chart');
|
||||||
$yAxisLabel1 = new Title('Value ($k)');
|
$yAxisLabel1 = new Title('Value ($k)');
|
||||||
|
|
@ -146,7 +146,7 @@ $series2->setPlotDirection(DataSeries::DIRECTION_COL);
|
||||||
// Set the series in the plot area
|
// Set the series in the plot area
|
||||||
$plotArea2 = new PlotArea(null, [$series2]);
|
$plotArea2 = new PlotArea(null, [$series2]);
|
||||||
// Set the chart legend
|
// Set the chart legend
|
||||||
$legend2 = new Legend(Legend::POSITION_RIGHT, null, false);
|
$legend2 = new ChartLegend(ChartLegend::POSITION_RIGHT, null, false);
|
||||||
|
|
||||||
$title2 = new Title('Test Column Chart');
|
$title2 = new Title('Test Column Chart');
|
||||||
$yAxisLabel2 = new Title('Value ($k)');
|
$yAxisLabel2 = new Title('Value ($k)');
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Layout;
|
use PhpOffice\PhpSpreadsheet\Chart\Layout;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Legend;
|
use PhpOffice\PhpSpreadsheet\Chart\Legend as ChartLegend;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
@ -73,7 +73,7 @@ $layout1->setShowPercent(true);
|
||||||
// Set the series in the plot area
|
// Set the series in the plot area
|
||||||
$plotArea1 = new PlotArea($layout1, [$series1]);
|
$plotArea1 = new PlotArea($layout1, [$series1]);
|
||||||
// Set the chart legend
|
// Set the chart legend
|
||||||
$legend1 = new Legend(Legend::POSITION_RIGHT, null, false);
|
$legend1 = new ChartLegend(ChartLegend::POSITION_RIGHT, null, false);
|
||||||
|
|
||||||
$title1 = new Title('Test Pie Chart');
|
$title1 = new Title('Test Pie Chart');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Layout;
|
use PhpOffice\PhpSpreadsheet\Chart\Layout;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Legend;
|
use PhpOffice\PhpSpreadsheet\Chart\Legend as ChartLegend;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
@ -79,7 +79,7 @@ $layout1->setShowPercent(true);
|
||||||
// Set the series in the plot area
|
// Set the series in the plot area
|
||||||
$plotArea1 = new PlotArea($layout1, [$series1]);
|
$plotArea1 = new PlotArea($layout1, [$series1]);
|
||||||
// Set the chart legend
|
// Set the chart legend
|
||||||
$legend1 = new Legend(Legend::POSITION_RIGHT, null, false);
|
$legend1 = new ChartLegend(ChartLegend::POSITION_RIGHT, null, false);
|
||||||
|
|
||||||
$title1 = new Title('Test Pie Chart');
|
$title1 = new Title('Test Pie Chart');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Layout;
|
use PhpOffice\PhpSpreadsheet\Chart\Layout;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Legend;
|
use PhpOffice\PhpSpreadsheet\Chart\Legend as ChartLegend;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
@ -85,7 +85,7 @@ $layout = new Layout();
|
||||||
// Set the series in the plot area
|
// Set the series in the plot area
|
||||||
$plotArea = new PlotArea($layout, [$series]);
|
$plotArea = new PlotArea($layout, [$series]);
|
||||||
// Set the chart legend
|
// Set the chart legend
|
||||||
$legend = new Legend(Legend::POSITION_RIGHT, null, false);
|
$legend = new ChartLegend(ChartLegend::POSITION_RIGHT, null, false);
|
||||||
|
|
||||||
$title = new Title('Test Radar Chart');
|
$title = new Title('Test Radar Chart');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Legend;
|
use PhpOffice\PhpSpreadsheet\Chart\Legend as ChartLegend;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
@ -68,7 +68,7 @@ $series = new DataSeries(
|
||||||
// Set the series in the plot area
|
// Set the series in the plot area
|
||||||
$plotArea = new PlotArea(null, [$series]);
|
$plotArea = new PlotArea(null, [$series]);
|
||||||
// Set the chart legend
|
// Set the chart legend
|
||||||
$legend = new Legend(Legend::POSITION_TOPRIGHT, null, false);
|
$legend = new ChartLegend(ChartLegend::POSITION_TOPRIGHT, null, false);
|
||||||
|
|
||||||
$title = new Title('Test Scatter Chart');
|
$title = new Title('Test Scatter Chart');
|
||||||
$yAxisLabel = new Title('Value ($k)');
|
$yAxisLabel = new Title('Value ($k)');
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Legend;
|
use PhpOffice\PhpSpreadsheet\Chart\Legend as ChartLegend;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
@ -79,7 +79,7 @@ $series = new DataSeries(
|
||||||
// Set the series in the plot area
|
// Set the series in the plot area
|
||||||
$plotArea = new PlotArea(null, [$series]);
|
$plotArea = new PlotArea(null, [$series]);
|
||||||
// Set the chart legend
|
// Set the chart legend
|
||||||
$legend = new Legend(Legend::POSITION_RIGHT, null, false);
|
$legend = new ChartLegend(ChartLegend::POSITION_RIGHT, null, false);
|
||||||
|
|
||||||
$title = new Title('Test Stock Chart');
|
$title = new Title('Test Stock Chart');
|
||||||
$xAxisLabel = new Title('Counts');
|
$xAxisLabel = new Title('Counts');
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Legend;
|
use PhpOffice\PhpSpreadsheet\Chart\Legend as ChartLegend;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
use PhpOffice\PhpSpreadsheet\Chart\PlotArea;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
use PhpOffice\PhpSpreadsheet\Chart\Title;
|
||||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||||
|
|
@ -71,7 +71,7 @@ $series->setPlotDirection(DataSeries::DIRECTION_BAR);
|
||||||
// Set the series in the plot area
|
// Set the series in the plot area
|
||||||
$plotArea = new PlotArea(null, [$series]);
|
$plotArea = new PlotArea(null, [$series]);
|
||||||
// Set the chart legend
|
// Set the chart legend
|
||||||
$legend = new Legend(Legend::POSITION_RIGHT, null, false);
|
$legend = new ChartLegend(ChartLegend::POSITION_RIGHT, null, false);
|
||||||
|
|
||||||
$title = new Title('Test Bar Chart');
|
$title = new Title('Test Bar Chart');
|
||||||
$yAxisLabel = new Title('Value ($k)');
|
$yAxisLabel = new Title('Value ($k)');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue