Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Allegiance-Consulting/blazor-highcharts
Blazor Wrapper for Highcharts library
https://github.com/Allegiance-Consulting/blazor-highcharts
Last synced: 10 days ago
JSON representation
Blazor Wrapper for Highcharts library
- Host: GitHub
- URL: https://github.com/Allegiance-Consulting/blazor-highcharts
- Owner: Allegiance-Consulting
- Created: 2020-01-18T15:23:48.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-12T15:21:19.000Z (7 months ago)
- Last Synced: 2024-08-01T15:05:49.554Z (3 months ago)
- Language: C#
- Size: 164 MB
- Stars: 33
- Watchers: 7
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-blazor - Blazor Highcharts - ![last commit](https://img.shields.io/github/last-commit/Allegiance-Consulting/blazor-highcharts?style=flat-square&cacheSeconds=86400) A port of the popular Highcharts library. [Demo](https://allegiance-consulting.github.io/blazor-highcharts/). (Libraries & Extensions / Tools & Utilities)
README
# blazor-highcharts
Blazor Wrapper for Highcharts libraryA Demo can be found https://allegiance-consulting.github.io/blazor-highcharts/
### Quick Installation Guide
Install Package.
Add the following to `_Imports.razor`
```razor
@using Allegiance.Blazor.Highcharts.Charts;
@using Allegiance.Blazor.Highcharts.Options;
@using Allegiance.Blazor.Highcharts.Constants;
@using Allegiance.Blazor.Highcharts.Services;
```
Add the following to `index.html`
```razor
```
Add the following to the relevant sections of `Program.cs`
```c#
using Allegiance.Blazor.Highcharts.Services;
```
```c#
builder.Services.AddSingleton();
```
### Usage
```razor
@using Allegiance.Blazor.Highcharts.Charts
@using Allegiance.Blazor.Highcharts.Options@inject IChartService chartService
@inject IJSRuntime jsRuntime
@implements IDisposable@code {
protected override void OnAfterRender(bool firstRender)
{
base.OnAfterRender(firstRender);
if (firstRender)
{
chartService.RenderChart("basicLine", BasicLineGraph.Generate());
}
}private ChartObject BasicLineGraph = new ChartObject()
{
Series = new List()
{
new SeriesElement("Series Element 1", new List(){
1, 10, 20, 30, 40, 50, 60, 70
}),
new SeriesElement("Series Element 2", new List(){
80, 40, 20, 10, 5, 2.5, 1.25, 0.625
}),
new SeriesElement("Series Element 3", new List(){
80/(10^7), 80/(10^6), 80/(10^5), 80/(10^4),80/(10^3), 80/(10^2), 80/(10^1), 80/(10^0)
}),
new SeriesElement("Series Element 4", new List(){
20,40,10,60,30,50,20,40
})
},
Title = new Title("Thisd is the Tittle"),
Subtitle = new Title("This is the Subtitle"),
YAxis = new YAxis(
new Title("Title of Y-axis")
),
XAxis = new XAxis(
new Accessibility("Title of Y-axis")
)
};public void Dispose()
{
BasicLineGraph.DisposeChart(jsRuntime, "basicLine");
}
}
```