You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The last step is to make the `Chart` from above, reachable from your code to configure it and to give it some data to display. In the `@code` section of your .razor file create matching variables to reference the chart and its configuration. Finally, give your chart a title and some data. The finished code should look like this:
91
+
The last step is to make the `ChartJsPieChart` from above, reachable from your code to configure it and to give it some data to display. In the `@code` section of your .razor file create matching variables to reference the chart and its configuration. Finally, give your chart a title and some data. The finished code should look like this:
@@ -141,9 +137,7 @@ First, in your `Index.html`/`_Host.cshtml` you've added references to static as
141
137
142
138
Then, you've imported `ChartJs.Blazor` in your `_Imports.razor`. The Blazor Team mentioned that this shouldn't be necessary in the future.
143
139
144
-
In your .razor file you added the `Chart` component and gave it some width and height. You specified that the component should use the variable `_config` as the chart's configuration object. You also told Blazor that you want a direct reference to the chart and that the reference should be saved in your `_pieChartJs` variable.
145
-
146
-
Note: for the moment you need to explicitly specify the type of the configuration object `TConfig="PieConfig"`. That won't be necessary in the future.
140
+
In your .razor file you added the `ChartJsPieChart` component and gave it some width and height. You specified that the component should use the variable `_config` as the chart's configuration object. You also told Blazor that you want a direct reference to the chart and that the reference should be saved in your `_pieChartJs` variable.
147
141
148
142
When your page's `OnInitialized()` method is executed you're setting the chart's configuration and dataset to be displayed.
149
143
@@ -246,17 +240,21 @@ When your page's `OnInitialized()` method is executed you're setting the chart's
246
240
```
247
241
248
242
### Dig deeper
249
-
Fordetailedinstructionsreadthe [Chart.Js](https://www.chartjs.org/docs/latest/charts/) documentation to understand how each chart works.
243
+
Fordetailedinstructionsreadthe [Chart.js](https://www.chartjs.org/docs/latest/charts/) documentation to understand how each chart works.
#### The current samples are flawed in many ways. If you would like to help improving them, please see [this issue](https://github.com/mariusmuntean/ChartJs.Blazor/issues/122).
TomakeiteasierforyoutoseewhatChartJs.BlazorcandoIhosttheclient-sidesampleswith [Netlify](https://www.netlify.com) on [www.iheartblazor.com](https://www.iheartblazor.com) (and a few other domains 😁)
TomakeiteasierforyoutoseewhatChartJs.Blazorcando, wehosttheclient-sidesampleswith [Netlify](https://www.netlify.com) on [www.iheartblazor.com](https://www.iheartblazor.com) (and a few other domains 😁).
255
+
However, thedemopagemightlagbehindabittoosoifyouwanttobesure, compilethe [samplesonthereleasesbranch](https://github.com/mariusmuntean/ChartJs.Blazor/tree/releases/samples).
0 commit comments