Skip to content

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.

MemberSignature
constructorconstructor(Kind $kind, array<Series> $series, array<Layer> $combined, ?string $title, ?string $xTitle, ?string $yTitle, Legend $legend, bool $labels): void
columncolumn(Options $options = null): Chart
barbar(Options $options = null): Chart
lineline(Options $options = null): Chart
areaarea(Options $options = null): Chart
piepie(Options $options = null): Chart
doughnutdoughnut(Options $options = null): Chart
scatterscatter(Options $options = null): Chart
withSerieswithSeries(string $values, SeriesOptions $options = null): Chart
combinedWithcombinedWith(Chart $other): Chart

Enums

Types

Series

type Series = {    values: string,    categories: ?string,    name: ?string,    color: ?string,};

Layer

type Layer = { kind: Kind, series: array<Series> };

Options

type Options = ?{    title?: string,    xTitle?: string,    yTitle?: string,    legend?: string,    labels?: bool,};

SeriesOptions

type SeriesOptions = ?{    categories?: string,    name?: string,    color?: string,};

Properties

  • $chart->kindKindthe type of the chart, such as a column chart
  • $chart->seriesarray<Series>the data of the chart, one entry for each withSeries call
  • $chart->combinedarray<Layer>the types and series that combinedWith added
  • $chart->title?stringthe title of the chart, or null
  • $chart->xTitle?stringthe title of the horizontal axis, or null
  • $chart->yTitle?stringthe title of the vertical axis, or null
  • $chart->legendLegendwhere the legend is, such as Legend::Right, or Legend::Hidden for no legend
  • $chart->labelsbooltrue when the chart shows each value on it