Brings Chart.js charts to Blazor
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:
IList<T>
.Chart
component which can work with any supplied chart config. The config is serialized and passed to Chart.js.ChartJs.Blazor.ChartJS
to ChartJs.Blazor
.Chart.defaults
).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.
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.
ChartJs.Blazor.ChartJS
to ChartJs.Blazor
(ee7c4609b710ad4c23006deb1b15e86e53a0e6f4)ChartJs.Blazor.Charts
and ChartJs.Blazor.Common.Properties
namespaces (merged with ChartJs.Blazor
and ChartJs.Blazor.Common
) (ee7c4609b710ad4c23006deb1b15e86e53a0e6f4)ChartData
class (c6a3df66dcfcef0e020ae7532d2a9fde72c2e81b)Chart
component (fb6e678f47477ae3371ba1379409bccc7594e890)JavaScriptHandler<T>
which allows interop with your own JavaScript functions (#70)DelegateHandler<T>
which allows interop with your own C# methods (actually any delegate will work now) (#70)Clip
option
BarConfig(bool horizontal = false)
(6a9d58e7c5c35d9d4465c5d0fc3334a203d0d971)IList<T>
and don't have any generic constraints.DoubleWrapper
, etc.)SetupCompletedCallback
to Chart
which makes registering plugins and manipulating the JavaScript object easier since you don't have do fiddle around with life cycle methodsSystem.Drawing.Color
with a custom alpha value (#118)ColorUtil
methods in specific cultures (#147)LineDataset
in BarConfig
) (56b5436a26f58adca5b62b50e9ed4ca0e796d87a)ChartJsInterop
and ExpandoObjectExtensions
MomentJsInterop
and PointUtil
DateTime
-wrapper Moment
AxisDirection
string enumBrowserEvent
string enumGridLines.LineWidth
indexableDelegateHandler<T>
Point
, TimePoint
, BubblePoint
and FloatingBarPoint
are now structsLineOptionsHover
was renamed to Hover
_content/ChartJs.Blazor.Fork/ChartJsBlazorInterop.js
instead of _content/ChartJs.Blazor/ChartJsBlazorInterop.js
(this is only required when referencing the alternative NuGet package)ChartJs.Blazor.Charts
and ChartJs.Blazor.Common.Properties
ChartJs.Blazor.ChartJS
with ChartJs.Blazor
LegendLabelConfiguration
with LegendLabels
xAxes
with XAxes
and yAxes
with YAxes
LineOptionsHover
with Hover
ChartJs[a-zA-Z]+Chart
with Chart
TimeTuple<[a-zA-Z]+>
with TimePoint
(which now always uses double
)true
to the PieOptions
constructor, pass true
to the PieConfig
constructor insteadJsHoverHandler
, JsClickHandler
etc. with JavaScriptHandler<T>
where T
is the appropriate delegate (hover over the property you're assigning it to)DotNetInstanceClickHandler
, DotNetInstanceHoverHandler
, DotNetStaticClickHandler
, etc. with DelegateHandler<T>
(just like above)DoubleWrapper
-> double
Moment
and just use your DateTime
objectstrue
to the constructors of your BarConfig
and BarDataset
sIf you have trouble migrating to version 2.0, please open an issue.
First preview of the upcoming 2.0 release. Changes:
Attention: this release includes breaking changes and it represents a work in progress.
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.