Skip to content

Commit

Permalink
Adjust readme for alternative NuGet Package, update Chart.js version
Browse files Browse the repository at this point in the history
  • Loading branch information
Joelius300 committed Nov 8, 2020
1 parent fb6e678 commit 73f513a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ChartJs.Blazor.Samples/Server/Pages/_Host.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
document.getElementById("blazorMode").src = window.location.search.includes("mode=server") ? "_framework/blazor.server.js" : "_framework/blazor.webassembly.js";
</script>

<script src="https://cdn.jsdelivr.net/npm/[email protected].3/dist/Chart.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].4/dist/Chart.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>

<!-- This is the glue between Blazor and Chart.js -->
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

[![Join the chat at https://gitter.im/ChartJs-Blazor/community](https://badges.gitter.im/ChartJs-Blazor/community.svg)](https://gitter.im/ChartJs-Blazor/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![NuGet Downloads](https://img.shields.io/nuget/dt/ChartJs.Blazor?label=NuGet%20Downloads)](https://www.nuget.org/packages/ChartJs.Blazor/)
[![NuGet Downloads (official NuGet)](https://img.shields.io/nuget/dt/ChartJs.Blazor?label=NuGet%20Downloads)](https://www.nuget.org/packages/ChartJs.Blazor/)
[![NuGet Downloads (2.0 NuGet)](https://img.shields.io/nuget/dt/ChartJs.Blazor.Fork?label=NuGet%20Downloads)](https://www.nuget.org/packages/ChartJs.Blazor.Fork/)

[![Netlify Status](https://api.netlify.com/api/v1/badges/4edc0972-1674-4ff7-8fdc-41e643b33738/deploy-status)](https://app.netlify.com/sites/chartjs-blazor-samples/deploys)

Expand All @@ -24,12 +25,15 @@ You need an IDE that supports Blazor and .NET Core SDK 3.x+

## Installation

There's a NuGet package available: [ChartJs.Blazor](https://www.nuget.org/packages/ChartJs.Blazor/)
**Due to an [unfortunate situation](https://github.com/mariusmuntean/ChartJs.Blazor/issues/160), the new 2.0 release is only available in an [alternative NuGet package](https://www.nuget.org/packages/ChartJs.Blazor.Fork/) for the time being.**
The original NuGet is [ChartJs.Blazor](https://www.nuget.org/packages/ChartJs.Blazor/).

Install our NuGet package: [ChartJs.Blazor.Fork](https://www.nuget.org/packages/ChartJs.Blazor.Fork/)

You can install it with the Package Manager in your IDE or alternatively using the command line:

```bash
dotnet add package ChartJs.Blazor
dotnet add package ChartJs.Blazor.Fork
```

## Usage
Expand All @@ -40,10 +44,10 @@ Before you can start creating a chart, you have to add some static assets to you
In your `_Host.cshtml` (server-side) or in your `index.html` (client-side) add the following lines to the `body` tag **after** the `_framework` reference.

```html
<script src="https://cdn.jsdelivr.net/npm/[email protected].3/dist/Chart.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].4/dist/Chart.min.js"></script>

<!-- This is the glue between Blazor and Chart.js -->
<script src="_content/ChartJs.Blazor/ChartJsBlazorInterop.js"></script>
<script src="_content/ChartJs.Blazor.Fork/ChartJsBlazorInterop.js"></script>
```

If you are using a time scale (`TimeAxis`), you also need to include Moment.js.
Expand Down Expand Up @@ -135,7 +139,7 @@ Unfortunately, we're not up to date yet and many samples are missing. If you'd l
The [ChartJs.Blazor.Samples folder](./ChartJs.Blazor.Samples) contains the projects to showcase the samples. It's based on [Suchiman/BlazorDualMode](https://github.com/Suchiman/BlazorDualMode) and allows you to switch between the server- and the client-side Blazor mode.

The samples should always be up to date with the current development on master. That means that the code you see on master might not work for your version.
To browse the samples for the latest nuget version, see the [samples on the releases branch](https://github.com/mariusmuntean/ChartJs.Blazor/tree/releases/ChartJs.Blazor.Samples/Client/Pages) or select a specific tag.
To browse the samples for the latest NuGet version, see the [samples on the releases branch](https://github.com/mariusmuntean/ChartJs.Blazor/tree/releases/ChartJs.Blazor.Samples/Client/Pages) or select a specific tag.
If there's not a sample for your use-case on the releases branch, check out the master one. Maybe someone already contributed what you're looking for and if not, why not do it yourself :wink:

We would usually host the samples on https://www.iheartblazor.com but unfortunately, the version shown there is really old and we highly recommend downloading and running our samples on your machine.
Expand Down
4 changes: 3 additions & 1 deletion src/ChartJs.Blazor/ChartJs.Blazor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
* Improved JavaScript interop layer and API (callbacks)
* Simplified namespaces
* Library no longer contains copy of Chart.js and moment.js builds
* Lots of bugfixes and other improvements</PackageReleaseNotes>
* Lots of bugfixes and other improvements

More on https://github.com/mariusmuntean/ChartJs.Blazor/releases/tag/v2.0.0</PackageReleaseNotes>
<AssemblyName>ChartJs.Blazor</AssemblyName>
<RootNamespace>ChartJs.Blazor</RootNamespace>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
Expand Down

0 comments on commit 73f513a

Please sign in to comment.