QuadrantChart Class

class QuadrantChart

Represents a Quadrant Chart

addPoint(Point ...$point)

Add point(s) to the Quadrant Chart

Parameters:
  • ...$point (Point) – The point(s)

Returns:

A new QuadrantChart instance with the point(s) added

Return type:

QuadrantChart

render(array $attributes = [])

Renders the diagram

Parameters:
  • $attributes (array) –

    HTML attributes for the <pre> tag as name=>value pairs

    Note

    The mermaid class is added

Returns:

Mermaid diagram code in a <pre> tag

Return type:

string

withAxes(array|string $x, array|string $y)

Set the labels for the X and Y axes

Parameters:
  • $x (list<string>|string) – X-axis label. Either (string) left axis label, or (array) left/right labels

  • $y (list<string>|string) – Y-axis label. Either (string) bottom axis label, or (array) bottom/top labels

Returns:

A new QuadrantChart instance with axes labels

Return type:

QuadrantChart

withComment(string $comment)

Set a comment for the Point

Parameters:
  • $comment (string) – The comment

Returns:

A new QuadrantChart instance with the comment

Return type:

QuadrantChart

withPoint(Point ...$point)

Set point(s) on the Quadrant Chart

Parameters:
  • ...$point (Point) – The point(s)

Returns:

A new QuadrantChart instance with the point(s)

Return type:

QuadrantChart

withQuadrants(string $tr, string $tl, string $bl, string $br)

Set the quadrant labels

Parameters:
  • $tr (string) – Label for the Top Right quadrant

  • $tl (string) – Label for the Top Left quadrant

  • $bl (string) – Label for the Bottom Left quadrant

  • $br (string) – Label for the Bottom Right quadrant

Returns:

A new QuadrantChart instance with the quadrant labels

Return type:

QuadrantChart

withTitle(string $title)

Set a title for the Quadrant Chart

Parameters:
  • $title (string) – The title

Returns:

A new QuadrantChart instance with the title

Return type:

QuadrantChart