Skip to content

Class \avadim\FastExcelWriter\Charts\Chart



__construct()


public function __construct($title, $plotArea, ?Legend $legend = null, 
                            ?bool $plotVisibleOnly = true, 
                            ?string $displayBlanksAs = '0', $xAxisLabel, 
                            $yAxisLabel, ?Axis $xAxis = null, 
                            ?Axis $yAxis = null, 
                            ?GridLines $majorGridlines = null, 
                            ?GridLines $minorGridlines = null)
Chart constructor

Parameters

  • Title|string $title
  • PlotArea|array $plotArea
  • Legend|null $legend
  • bool|null $plotVisibleOnly
  • string|null $displayBlanksAs
  • Title|string|null $xAxisLabel
  • Title|string|null $yAxisLabel
  • Axis|null $xAxis
  • Axis|null $yAxis
  • GridLines|null $majorGridlines
  • GridLines|null $minorGridlines

make()


public static function make(string $chartType, $title, $dataSource): Chart
Create Chart instance

Parameters

  • string $chartType
  • Title|string|null $title
  • DataSeries|PlotArea|array|null $dataSource

addDataSeriesSet()


public function addDataSeriesSet(array $dataSources): Chart
Add multiple data series to the chart

Parameters

  • array $dataSources

addDataSeriesType()


public function addDataSeriesType(string $chartType, $dataSource, 
                                  ?string $dataLabel = null, 
                                  ?array $options = []): Chart
Add data series of specific type (used for combo charts)

Parameters

  • string $chartType
  • DataSeriesValues|string $dataSource
  • string|null $dataLabel
  • array|null $options

addDataSeriesType2()


public function addDataSeriesType2(string $chartType, $dataSource, 
                                   ?string $dataLabel = null, 
                                   ?array $options = []): Chart
Add data series of specific type to the second axis (used for combo charts)

Parameters

  • string $chartType
  • DataSeriesValues|string $dataSource
  • string|null $dataLabel
  • array|null $options

addDataSeriesValues()


public function addDataSeriesValues($dataSource, ?string $dataLabel = null, 
                                    ?array $options = []): Chart
Add data series values to the chart

Parameters

  • DataSeriesValues|array|string $dataSource
  • string|null $dataLabel
  • array|null $options

getBottomRightCell()


public function getBottomRightCell(): string
Get the cell address where the bottom right of the chart is fixed

Parameters

None


getBottomRightOffset()


public function getBottomRightOffset(): array
Get the offset position within the Bottom Right cell for the chart

Parameters

None


getBottomRightPosition()


public function getBottomRightPosition(): array
Get the bottom right position of the chart

Parameters

None


getBottomRightXOffset()


public function getBottomRightXOffset(): int
Get Bottom Right X-Offset

Parameters

None


getBottomRightYOffset()


public function getBottomRightYOffset(): int
Get Bottom Right Y-Offset

Parameters

None


getCategoryAxisTitle()


public function getCategoryAxisTitle(): ?Title
Get Category Axis Title

Parameters

None


getChartAxisX()


public function getChartAxisX(): ?Axis
Get X Axis

Parameters

None


getChartAxisY()


public function getChartAxisY(): ?Axis
Get Y Axis

Parameters

None


getChartAxisY2()


public function getChartAxisY2(): ?Axis
Get Y Axis 2

Parameters

None


getDisplayBlanksAs()


public function getDisplayBlanksAs(): string
Get Display Blanks As

Parameters

None


getLegend()


public function getLegend(): ?Legend
Get Chart Legend

Parameters

None


getMajorGridlines()


public function getMajorGridlines(): ?GridLines
Get Major Gridlines

Parameters

None


getMinorGridlines()


public function getMinorGridlines(): ?GridLines
Get Minor Gridlines

Parameters

None


getName()


public function getName(): string
Get Chart Name

Parameters

None


getPlotArea()


public function getPlotArea(): PlotArea
Get Plot Area

Parameters

None


getPlotChartTypes()


public function getPlotChartTypes(): array
Get the data series type(s) for a chart plot series

Parameters

None


getPlotVisibleOnly()


public function getPlotVisibleOnly(): bool
Get Plot Visible Only

Parameters

None


getTitle()


public function getTitle(): Title
Get Chart Title

Parameters

None


getTopLeftCell()


public function getTopLeftCell(): string
Get the cell address where the top left of the chart is fixed

Parameters

None


getTopLeftOffset()


public function getTopLeftOffset(): array
Get the offset position within the Top Left cell for the chart

Parameters

None


getTopLeftPosition()


public function getTopLeftPosition(): array
Get the top left position of the chart

Parameters

None


getTopLeftXOffset()


public function getTopLeftXOffset(): int
Get Top Left X-Offset

Parameters

None


getTopLeftYOffset()


public function getTopLeftYOffset(): int
Get Top Left Y-Offset

Parameters

None


getValueAxisTitle()


public function getValueAxisTitle(): ?Title
Get Value Axis Title

Parameters

None


getValueAxisTitle2()


public function getValueAxisTitle2(): ?Title
Get Y2 Axis Title

Parameters

None


setBottomRightCell()


public function setBottomRightCell(string $cell): Chart
Set Bottom Right Cell

Parameters

  • string $cell

setBottomRightOffset()


public function setBottomRightOffset(?int $xOffset = null, 
                                     ?int $yOffset = null): Chart
Set the offset position within the Bottom Right cell for the chart

Parameters

  • int|null $xOffset
  • int|null $yOffset

setBottomRightXOffset()


public function setBottomRightXOffset(int $xOffset): Chart
Set Bottom Right X-Offset

Parameters

  • int $xOffset

setBottomRightYOffset()


public function setBottomRightYOffset(int $yOffset): Chart
Set Bottom Right Y-Offset

Parameters

  • int $yOffset

setCategoryAxis()


public function setCategoryAxis($labels, $title): Chart
Set Category Axis Labels and Title

Parameters

  • DataSeriesValues|array|string $labels
  • Title|string|null $title

setCategoryAxisLabels()


public function setCategoryAxisLabels($labels): Chart
Set Category Axis Labels (tick labels)

Parameters

  • DataSeriesValues|array|string $labels

setCategoryAxisTitle()


public function setCategoryAxisTitle($title): Chart
Set Category Axis Title

Parameters

  • Title|string $title

setChartColors()


public function setChartColors(array $colors): Chart
Set Chart Colors

Parameters

  • array $colors

setChartType()


public function setChartType(string $chartType): Chart
Set Chart Type

Parameters

  • string $chartType

setDataSeriesNames()


public function setDataSeriesNames($labels): Chart
Set Data Series Names

Parameters

  • DataSeriesValues|array|string $labels

setDataSeriesTickLabels()


public function setDataSeriesTickLabels($range): Chart
Set Data Series Tick Labels

Parameters

  • DataSeriesValues|array|string $range

setDisplayBlanksAs()


public function setDisplayBlanksAs(string $displayBlanksAs = '0'): Chart
Set Display Blanks As

Parameters

  • string $displayBlanksAs

setLegend()


public function setLegend(avadim\FastExcelWriter\Charts\Legend $legend): Chart
Set Chart Legend

Parameters

  • Legend $legend

setLegendPosition()


public function setLegendPosition(string $position): Chart
Set Chart Legend Position

Parameters

  • string $position

setLegendPositionBottom()


public function setLegendPositionBottom(): Chart
Set Chart Legend Position to Bottom

Parameters

None


setLegendPositionLeft()


public function setLegendPositionLeft(): Chart
Set Chart Legend Position to Left

Parameters

None


setLegendPositionRight()


public function setLegendPositionRight(): Chart
Set Chart Legend Position to Right

Parameters

None


setLegendPositionTop()


public function setLegendPositionTop(): Chart
Set Chart Legend Position to Top

Parameters

None


setName()


public function setName(string $name): Chart
Set Chart Name

Parameters

  • string $name

setPlotArea()


public function setPlotArea($plotValues): Chart
Set Chart Plot Area

Parameters

  • PlotArea|array $plotValues

setPlotLayout()


public function setPlotLayout($layout): Chart
Set Plot Layout

Parameters

  • Layout|array|null $layout

setPlotShowPercent()


public function setPlotShowPercent(bool $val): Chart
Set Plot Show Percent

Parameters

  • bool $val

setPlotShowValues()


public function setPlotShowValues(bool $val): Chart
Set Plot Show Values

Parameters

  • bool $val

setPlotVisibleOnly()


public function setPlotVisibleOnly(bool $plotVisibleOnly = true): Chart
Set Plot Visible Only

Parameters

  • bool $plotVisibleOnly

setPosition()


public function setPosition(string $cell, ?int $xOffset = null, 
                            ?int $yOffset = null): Chart
Set the Bottom Right position of the chart

Parameters

  • string $cell
  • int|null $xOffset
  • int|null $yOffset

setSheet()


public function setSheet(avadim\FastExcelWriter\Sheet $sheet): Chart
Set Sheet

Parameters

  • Sheet $sheet

setTitle()


public function setTitle($title): Chart
Set Chart Title

Parameters

  • Title|string $title

setTopLeftCell()


public function setTopLeftCell(string $cell): Chart
Set the Top Left cell position for the chart

Parameters

  • string $cell

setTopLeftOffset()


public function setTopLeftOffset(?int $xOffset = null, 
                                 ?int $yOffset = null): Chart
Set the offset position within the Top Left cell for the chart

Parameters

  • integer|null $xOffset
  • integer|null $yOffset

setTopLeftPosition()


public function setTopLeftPosition(string $cell, ?int $xOffset = null, 
                                   ?int $yOffset = null): Chart
Set the Top Left position for the chart

Parameters

  • string $cell
  • integer|null $xOffset
  • integer|null $yOffset

setTopLeftXOffset()


public function setTopLeftXOffset($xOffset): Chart
Set Top Left X-Offset

Parameters

  • int $xOffset

setTopLeftYOffset()


public function setTopLeftYOffset($yOffset): Chart
Set Top Left Y-Offset

Parameters

  • int $yOffset

setValueAxisTitle()


public function setValueAxisTitle($title): Chart
Set Value Axis Title

Parameters

  • Title|string $title

setValueAxisTitle2()


public function setValueAxisTitle2($title): Chart
Set Y2 Axis Title

Parameters

  • Title|string $title