A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/mariusmuntean/ChartJs.Blazor/commit/fb6e678f47477ae3371ba1379409bccc7594e890 below:

Remove the generic parameter of the Chart component · mariusmuntean/ChartJs.Blazor@fb6e678 · GitHub

File tree Expand file treeCollapse file tree 10 files changed

+16

-19

lines changed

Filter options

Expand file treeCollapse file tree 10 files changed

+16

-19

lines changed Original file line number Diff line number Diff line change

@@ -3,7 +3,7 @@

3 3

@using System.Drawing

4 4

@layout SampleLayout

5 5 6 -

<Chart TConfig="BarConfig" Config="_config" @ref="_chart"></Chart>

6 +

<Chart Config="_config" @ref="_chart"></Chart>

7 7 8 8

<button @onclick="RandomizeData">Randomize Data</button>

9 9

<button @onclick="AddDataset">Add Dataset</button>

@@ -15,7 +15,7 @@

15 15

private const int InitalCount = 7;

16 16

private BarConfig _config;

17 17

private Random _rng = new Random();

18 -

private Chart<BarConfig> _chart;

18 +

private Chart _chart;

19 19 20 20

protected override void OnInitialized()

21 21

{

Original file line number Diff line number Diff line change

@@ -3,15 +3,15 @@

3 3

@using ChartJs.Blazor.BarChart.Axes

4 4

@layout SampleLayout

5 5 6 -

<Chart TConfig="BarConfig" Config="_config" @ref="_chart"></Chart>

6 +

<Chart Config="_config" @ref="_chart"></Chart>

7 7 8 8

<button @onclick="RandomizeData">Randomize Data</button>

9 9 10 10

@code {

11 11

private const int InitalCount = 7;

12 12

private BarConfig _config;

13 13

private Random _rng = new Random();

14 -

private Chart<BarConfig> _chart;

14 +

private Chart _chart;

15 15 16 16

protected override void OnInitialized()

17 17

{

Original file line number Diff line number Diff line change

@@ -3,7 +3,7 @@

3 3

@using System.Drawing

4 4

@layout SampleLayout

5 5 6 -

<Chart TConfig="BarConfig" Config="_config" @ref="_chart"></Chart>

6 +

<Chart Config="_config" @ref="_chart"></Chart>

7 7 8 8

<button @onclick="RandomizeData">Randomize Data</button>

9 9

<button @onclick="AddDataset">Add Dataset</button>

@@ -15,7 +15,7 @@

15 15

private const int InitalCount = 7;

16 16

private BarConfig _config;

17 17

private Random _rng = new Random();

18 -

private Chart<BarConfig> _chart;

18 +

private Chart _chart;

19 19 20 20

protected override void OnInitialized()

21 21

{

Original file line number Diff line number Diff line change

@@ -2,7 +2,7 @@

2 2

@using ChartJs.Blazor.LineChart

3 3

@layout SampleLayout

4 4 5 -

<Chart TConfig="LineConfig" Config="_config" @ref="_chart"></Chart>

5 +

<Chart Config="_config" @ref="_chart"></Chart>

6 6 7 7

<button @onclick="RandomizeData">Randomize Data</button>

8 8

<button @onclick="AddDataset">Add Dataset</button>

@@ -14,7 +14,7 @@

14 14

private const int InitalCount = 7;

15 15

private LineConfig _config;

16 16

private Random _rng = new Random();

17 -

private Chart<LineConfig> _chart;

17 +

private Chart _chart;

18 18 19 19

protected override void OnInitialized()

20 20

{

Original file line number Diff line number Diff line change

@@ -6,7 +6,7 @@

6 6

@foreach (Variant variant in _variants)

7 7

{

8 8

<div class="chart-container">

9 -

<Chart TConfig="LineConfig" Config="GetConfig(variant)"></Chart>

9 +

<Chart Config="GetConfig(variant)"></Chart>

10 10

</div>

11 11

}

12 12

</div>

Original file line number Diff line number Diff line change

@@ -3,7 +3,7 @@

3 3

@using System.Drawing

4 4

@layout SampleLayout

5 5 6 -

<Chart TConfig="PieConfig" Config="_config" @ref="_chart"></Chart>

6 +

<Chart Config="_config" @ref="_chart"></Chart>

7 7 8 8

<button @onclick="RandomizeData">Randomize Data</button>

9 9

<button @onclick="AddDataset">Add Dataset</button>

@@ -13,7 +13,7 @@

13 13

private const int InitalCount = 5;

14 14

private PieConfig _config;

15 15

private Random _rng = new Random();

16 -

private Chart<PieConfig> _chart;

16 +

private Chart _chart;

17 17 18 18

protected override void OnInitialized()

19 19

{

Original file line number Diff line number Diff line change

@@ -3,7 +3,7 @@

3 3

@layout SampleLayout

4 4

@inject IJSRuntime jsRuntime

5 5 6 -

<Chart TConfig="LineConfig" Config="_config" SetupCompletedCallback="@SetupCompletedCallback"></Chart>

6 +

<Chart Config="_config" SetupCompletedCallback="@SetupCompletedCallback"></Chart>

7 7 8 8

@code {

9 9

private const int InitalCount = 7;

Original file line number Diff line number Diff line change

@@ -83,7 +83,7 @@ In order to use the classes for a pie chart, we need to add `@using ChartJs.Blaz

83 83

Then we can add a `Chart` component anywhere in the markup like so:

84 84 85 85

```html

86 -

<Chart TConfig="PieConfig" Config="_config"></Chart>

86 +

<Chart Config="_config"></Chart>

87 87

```

88 88 89 89

The only thing left to do now is to provide the data and chart configuration by declaring an instance variable which we reference in the `Chart` component.

@@ -202,7 +202,7 @@ If you run into an issue, we recommend you to do the following steps:

202 202

* ***Alternative Option*** - manually invoke the `ReferenceConverter` constructor to avoid the linker optimizing it away. Example:

203 203 204 204

```csharp

205 -

private ReferenceConverter ReferenceConverter = new ReferenceConverter(typeof(Chart<PieConfig>));

205 +

private ReferenceConverter ReferenceConverter = new ReferenceConverter(typeof(Chart));

206 206

```

207 207 208 208

# Contributors

Original file line number Diff line number Diff line change

@@ -1,3 +1 @@

1 -

@typeparam TConfig

2 - 3 1

<canvas id="@Config.CanvasId" width="@Width" height="@Height"></canvas>

Original file line number Diff line number Diff line change

@@ -10,8 +10,7 @@ namespace ChartJs.Blazor

10 10

/// <summary>

11 11

/// Represents a Chart.js chart.

12 12

/// </summary>

13 -

/// <typeparam name="TConfig">The type of config to pass to Chart.js.</typeparam>

14 -

public partial class Chart<TConfig> where TConfig : ConfigBase

13 +

public partial class Chart

15 14

{

16 15

/// <summary>

17 16

/// This event is fired when the chart has been setup through interop and

@@ -31,7 +30,7 @@ public partial class Chart<TConfig> where TConfig : ConfigBase

31 30

/// Gets or sets the configuration of the chart.

32 31

/// </summary>

33 32

[Parameter]

34 -

public TConfig Config { get; set; }

33 +

public ConfigBase Config { get; set; }

35 34 36 35

/// <summary>

37 36

/// Gets or sets the width of the canvas HTML element.

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4