Skip to content

Commit

Permalink
Update example charts to work with Chart JS version 4.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Thomson committed Mar 24, 2024
1 parent a0bb14a commit acaba0d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ $chart->optionsRaw("{
# Examples
1 - Line Chart / Radar Chart:
1 - Line Chart:
```php
// ExampleController.php
Expand All @@ -135,7 +135,8 @@ $chartjs = app()->chartjs
"pointBackgroundColor" => "rgba(38, 185, 154, 0.7)",
"pointHoverBackgroundColor" => "#fff",
"pointHoverBorderColor" => "rgba(220,220,220,1)",
'data' => [65, 59, 80, 81, 56, 55, 40],
"data" => [65, 59, 80, 81, 56, 55, 40],
"fill" => false,
],
[
"label" => "My Second dataset",
Expand All @@ -145,7 +146,8 @@ $chartjs = app()->chartjs
"pointBackgroundColor" => "rgba(38, 185, 154, 0.7)",
"pointHoverBackgroundColor" => "#fff",
"pointHoverBorderColor" => "rgba(220,220,220,1)",
'data' => [12, 33, 44, 44, 55, 23, 40],
"data" => [12, 33, 44, 44, 55, 23, 40],
"fill" => false,
]
])
->options([]);
Expand Down Expand Up @@ -182,7 +184,13 @@ $chartjs = app()->chartjs
'data' => [65, 12]
]
])
->options([]);
->options([
"scales" => [
"y" => [
"beginAtZero" => true
]
]
]);
return view('example', compact('chartjs'));
Expand Down

0 comments on commit acaba0d

Please sign in to comment.