Skip to content

Releases: mariusmuntean/ChartJs.Blazor

Release-2.0.2

11 Jan 08:21
Compare
Choose a tag to compare
  • Remove disruptive launchSettings that could override your own (#175).

Release-2.0.1

01 Jan 10:23
Compare
Choose a tag to compare
  • Fix bug related to the ticks-callback in single-scale charts (#171, #170). Thanks @ipax77

Release-2.0.0 | the release that should've been 1.0

08 Nov 18:29
Compare
Choose a tag to compare

The library is now in a stable state and ready for production use. More features will be added over time.

We highly recommend everyone to upgrade to Version 2.0.
There are a lot of changes but the migration won't take long and you can find a migration guide below.

Important:
Due to an unfortunate situation, the new 2.0 release is only available in an alternative NuGet package for the time being.

In order to get to this stable state, a lot of parts were reworked. The highlights are:

  • Completely rewritten datasets. They're fully generic and implement the default IList<T>.
  • A single Chart component which can work with any supplied chart config. The config is serialized and passed to Chart.js.
  • Typesafe callbacks for easy C#-interop. Some callbacks which return values (e.g. filter callbacks) are now also supported but only on client-side Blazor.
  • Simplified namespaces by reducing ChartJs.Blazor.ChartJS to ChartJs.Blazor.
  • Make every option nullable. This means that Chart.js will choose their default if you don't specify a value. This has several benefits like respecting changes in the global defaults (in JavaScript Chart.defaults).
  • Lots of missing properties have now been added to better leverage the potential of Chart.js 2.9.
  • Lots of bugs have been fixed (e.g. colors work on all cultures now).

As part of the 2.0 release, we've also completely redone the samples to reflect the official Chart.js samples. However, we're not done yet and many samples are missing. If you'd like to help, please check out this issue.

Changes

The changelog for this release is quite big. I tried my best to include everything (in no particular order) but I might've missed some things.

  • Simplified namespaces by reducing ChartJs.Blazor.ChartJS to ChartJs.Blazor (ee7c460)
  • Remove ChartJs.Blazor.Charts and ChartJs.Blazor.Common.Properties namespaces (merged with ChartJs.Blazor and ChartJs.Blazor.Common) (ee7c460)
  • Remove the Chart.js and moment.js scripts (#95)
  • Merge chart data classes into single ChartData class (c6a3df6)
  • Merge all chart components into single Chart component (fb6e678)
  • Add JavaScriptHandler<T> which allows interop with your own JavaScript functions (#70)
  • Add DelegateHandler<T> which allows interop with your own C# methods (actually any delegate will work now) (#70)
  • Add support for the Clip option
  • Make every option nullable to make use of Chart.js' (adjustable) defaults (6c45391)
  • Simplify creation of horizontal bar charts by changing the constructor to BarConfig(bool horizontal = false) (6a9d58e)
  • Rework every dataset (#96, #112, #133)
    • One of the biggest changes in this is the large amount of new properties that just weren't supported before. I won't list them all here.
    • Datasets now implement IList<T> and don't have any generic constraints.
    • All the value-type wrappers were removed (DoubleWrapper, etc.)
  • Add support for floating bars (#100)
  • Add SetupCompletedCallback to Chart which makes registering plugins and manipulating the JavaScript object easier since you don't have do fiddle around with life cycle methods
  • Went through all the chart configs/options and added the appropriate properties for Chart.js 2.9. There are simply too many to list here but you'll find that the library is more complete now (but there will still be things missing).
  • Allow settings the step size in radar charts (#110)
  • Add support for plugin options (#63)
  • Fix bug preventing the use of System.Drawing.Color with a custom alpha value (#118)
  • Fix bug preventing the use of some ColorUtil methods in specific cultures (#147)
  • Add custom Ticks Format callback (#62)
  • Add typesafe filling mode (#56)
  • Remove specific classes for mixed charts as every chart is mixable, you just have to add a dataset with a different type (e.g. LineDataset in BarConfig) (56b5436)
  • Hide internal classes like ChartJsInterop and ExpandoObjectExtensions
  • Remove out of scope classes like MomentJsInterop and PointUtil
  • Remove the unnecessary DateTime-wrapper Moment
  • Remove unnecessary divs around canvas (54f317f)
  • Avoid swallowing exceptions when setting up/updating the chart. These will now bubble up and need to be handled instead of just being printed to the console.
  • Add AxisDirection string enum
  • Add BrowserEvent string enum
  • Make GridLines.LineWidth indexable
  • Seal DelegateHandler<T>
  • Point, TimePoint, BubblePoint and FloatingBarPoint are now structs
  • LineOptionsHover was renamed to Hover

Migrate from Version 1.x to 2.0

  • Reference the Chart.js (and moment.js) scripts from some other source like a CDN or download and include it in your application
  • Reference _content/ChartJs.Blazor.Fork/ChartJsBlazorInterop.js instead of _content/ChartJs.Blazor/ChartJsBlazorInterop.js (this is only required when referencing the alternative NuGet package)
  • Remove imports of ChartJs.Blazor.Charts and ChartJs.Blazor.Common.Properties
  • Search and replace ChartJs.Blazor.ChartJS with ChartJs.Blazor
  • Search and replace LegendLabelConfiguration with LegendLabels
  • Search and replace xAxes with XAxes and yAxes with YAxes
  • Search and replace LineOptionsHover with Hover
  • Search and replace (regex) ChartJs[a-zA-Z]+Chart with Chart
  • Search and replace (regex) TimeTuple<[a-zA-Z]+> with TimePoint (which now always uses double)
  • If you were passing true to the PieOptions constructor, pass true to the PieConfig constructor instead
  • Replace JsHoverHandler, JsClickHandler etc. with JavaScriptHandler<T> where T is the appropriate delegate (hover over the property you're assigning it to)
  • Replace DotNetInstanceClickHandler, DotNetInstanceHoverHandler, DotNetStaticClickHandler, etc. with DelegateHandler<T> (just like above)
  • Replace all references to the number wrappers and replace them with the actual types. E.g. DoubleWrapper -> double
  • Remove all mentions of Moment and just use your DateTime objects
  • If you're using horizontal bar charts, simply pass true to the constructors of your BarConfig and BarDatasets

If you have trouble migrating to version 2.0, please open an issue.

Release-2.0.0-preview1

12 Jun 09:19
Compare
Choose a tag to compare
Pre-release

First preview of the upcoming 2.0 release.
Changes:

  • Improved JavaScript interop layer and API.
  • Datasets were reworked.
  • Unified all charts into one Blazor component.
  • Bugfixes and performance improvements.

Attention: this release includes breaking changes and it represents a work in progress.

Release-1.1.0

28 Mar 12:50
Compare
Choose a tag to compare
  • Update chart title configuration (#65, #67). Thanks @RestoreMonarchy!
  • Update tick configuration (#68)
  • Update animation configuration (#86, #73, #74). Thanks @ItsMeDan11!
  • Respect the aspect ratio configuration (#88). Thanks @esso23!
  • Add option for creating a custom chart type (#25). Thanks @oleksiizapara!
  • Rework the string- and object-enum with de/serialization in focus (#84). This is a prerequisit for #70 and shouldn't have external changes but also means better documentation and improved/fixed equality behaviour.

In this release we also bumped the .net standard version to 2.1. Considering this is currently only really usable with blazor, it's not an issue yet. Once we start to split the projects in order to make this library usable in other contexts (#78) we might need to revisit that decision.

On a different note, we now use Semantic Versioning going forward which might mean higher version numbers considering that there are still lots of breaking changes that need to happen in the future. Also the tag names now comply with standard git practice. The release names will be continued in the same fashion as before.