UncleCheese\Dashboard\DashboardChart
An API for creating a Google chart in a dashboard panel
- Author: Uncle Cheese <unclecheese@leftandmain.com>
Synopsis
class DashboardChart
extends ViewableData
{
- // members
- private static integer $instances = 0;
- protected array $chartData = ;
- public integer $TextInterval = 5;
- public integer $Height = 200;
- public integer $PointSize = 5;
- public integer $FontSize = 10;
- public string $TextPosition = 'in';
- // methods
- public static DashboardChart create()
- public void __construct()
- public string getChartID()
- public ArrayList getChartData()
- public void addData()
- public void setData()
- public DBHTMLText forTemplate()
Hierarchy
Extends
- SilverStripe\View\ViewableData
Members
private
- $instances — int
protected
- $chartData — array
public
- $FontSize — int
- $Height — int
- $PointSize — int
- $TextInterval — int
- $TextPosition — string
Methods
public
- __construct() — Constructor for the DashboardChart
- addData() — Adds a single data point to the chart
- create() — Creates a new instance of a DashboardChart
- forTemplate() — Renders the chart and loads the dependencies
- getChartData() — Gets a list of x/y pairs for the template
- getChartID() — The ID of the chart. Javascript needs to target a specific element
- setData() — Sets the chart data, in x/y pairs