API¶
Yii Chartist API documentation
- class BeastBytes\Yii\Chartist\Chartist¶
- static Chartist::widget(Yiisoft\Assets\AssetManager $assetManager, Yiisoft\View\WebView $view)¶
Instantiate a Chartist instance
- Parameters:
$assetManager (
YiisoftAssetsAssetManager) – The asset manager that will publish the required JavaScript$view (
YiisoftViewWebView) – The view in which to render the chart
- Returns:
A new Chartist instance
- Return type:
- static jsExpression(string $value)¶
Marks the value as a JavaScript expression to ensure correct encoding
- Returns:
The value marked as a JavaScript expression
- Return type:
string
- id(string $id)¶
Sets the widget id
If not called the widget generates a unique id that matches the regex chart_\d{15}
See
Chartist::getId- Parameters:
$id (
string) – The widget id
- Returns:
A new Chartist instance with the id
- Return type:
- data(array $data)¶
Defines the chart data and labels
- Returns:
A new Chartist instance with the data
- Return type:
- getId()¶
See
Chartist::id- Returns:
The widget id
- Return type:
string
- options(array $options)¶
Set Chart options
- Parameters:
$options (
array) – Widget options
- Returns:
A new Chartist instance with the options
- Return type:
- responsiveOptions(array $responsiveOptions)¶
Set Chart responsive design options
- Parameters:
$options (
array) – Widget responsive design options
- Returns:
A new Chartist instance with the responsive design options