Novis\Spreadsheet\Chart
One chart for a sheet. Start it with its type, such as Chart::column(), then add its data with withSeries. Sheet::addChart puts the chart on a sheet. A Chart does not change: each method returns a new chart.
Members
10 members.
| Member | Signature |
|---|---|
constructor | constructor(Kind $kind, array<Series> $series, array<Layer> $combined, ?string $title, ?string $xTitle, ?string $yTitle, Legend $legend, bool $labels): void |
column | column(Options $options = null): Chart |
bar | bar(Options $options = null): Chart |
line | line(Options $options = null): Chart |
area | area(Options $options = null): Chart |
pie | pie(Options $options = null): Chart |
doughnut | doughnut(Options $options = null): Chart |
scatter | scatter(Options $options = null): Chart |
withSeries | withSeries(string $values, SeriesOptions $options = null): Chart |
combinedWith | combinedWith(Chart $other): Chart |
Enums
Kind { Column, Bar, Line, Area, Pie, Doughnut, Scatter }The type of a chart.Columnis a chart with vertical bars, andBaris a chart with horizontal bars.Doughnutis a pie chart with a hole in the middle.Legend { Hidden, Top, Right, Bottom, Left }Where a chart shows its legend.Hiddenshows no legend.
Types
Series
Layer
Options
SeriesOptions
Properties
$chart->kindKindthe type of the chart, such as a column chart$chart->seriesarray<Series>the data of the chart, one entry for eachwithSeriescall$chart->combinedarray<Layer>the types and series thatcombinedWithadded$chart->title?stringthe title of the chart, ornull$chart->xTitle?stringthe title of the horizontal axis, ornull$chart->yTitle?stringthe title of the vertical axis, ornull$chart->legendLegendwhere the legend is, such asLegend::Right, orLegend::Hiddenfor no legend$chart->labelsbooltruewhen the chart shows each value on it
