Skip to content

v2.0.0-rc5

Pre-release
Pre-release
Compare
Choose a tag to compare
@beto-rodriguez beto-rodriguez released this 16 Jan 07:29
fc8320b

This release brings a lot of improvements to the library, more than 400 commits from the last release; The library it is now compatible with net 9 on Maui, uses SkiaSharp 3 by default (when the UI framework supports it), it supports now GPU rendering (when the UI framework supports it), fixes a lot of pointer-interaction-related issues, improves events, visual elements are easier to customize, and also the drawing engine was re-structured.

Drawing engine improvements

The drawing engine in older versions was really simple, as the library evolved new features were required, like Layouts, but there was one thing missing, when an element was inside a layout, Canvas transform was not applied to the children, this is now supported and required important changes in the internal code of the library that handles drawing, this feature is now used by default on tooltips:

t

The opacity and scale from the tooltip geometry is also applied to the content inside the tooltip, that was missing in the library and was impossible in older versions, it is a small detail but was required.

The drawing engine code is much cleaner now, the library used interfaces to define all shapes in the core of library, for example the IRoundedRectangleGeometry, then on the SkiaSharp assembly, there was an implementation of this interface; Now instead there is a base abstract class in the core of the library (BaseRoundedRectangleGeometry that inherits from DrawnGeometry), this base class handles animations and transforms, then on the SkiaSharp assembly, we inherit from this base class and just use SkiaSharp to draw the rectangle (see RoundedRectangleGeometry), this is much cleaner and has the potential to remove the dependency of the library on SkiaSharp.

More info at #1705.

Maui Net 9 friendly

in older versions, Maui handlers were not registered following the Maui logic, this caused issues like #1684, or #1703 this is now fixed, but there are breaking changes, you must now call .UseLiveCharts() in the MauiProgram.cs file, more info in the installation guide.

New Visual elements

VisualElements felt hacky, they were hard to customize, now it is much easier to draw anything we need in the canvas, there a lot of new examples in the web site, the old Visuals are still supported but some of them are marked as obsolete.

GPU rendering

When your app starts, you can now call LiveCharts.UseGPU = true this will use the Hardware accelerated view provided by SkiaSharp, there are known limitations, this is not supported on NetFramework due #3111, and also not on Avalonia or Eto, where they provide the Skia assemblies.

New FPS log

We can now know the frames per second on a chart by setting LiveCharts.ShowFPS = true; and even try to get more, for example LiveCharts.MaxFps = 90;, the default is 65, not supported on Avalonia, where frames are handled by the framework.

fps

How many FPS can Blazor render?

blazor-tp-fps

About 60, not bad! but that was only the tooltip, now let's move the chart:

blazor-fps

Still decent ❤️

Pointer interaction

There is a lot of feedback about how users try to interact with the chart, this version tries to take all that feedback and provide a solution for all the cases, the FindingStrategy property on a CartesianChart, is more flexible, this property allows the user to configure how the library selects points on the chart, the library provides 8 different strategies, but when that is not enough you also create your own logic now, more info at #1687.

The events article was also updated to explain more about this common scenario.

Axis scales

The axis scale is now completely flexible, there is a new article in the site that explains it.

Bye Xamarin

Xamarin is no longer supported.
 

Breaking Changes

In general, if you are not doing any customization like drawing your own legend, tooltip, a custom visual element or any call to the internal API in the library to draw things, then you are ok, there are no changes, but as explained the Drawing engine was re-structured, this means that any custom draw is probably affected by the API changes, in general the migration should be easy, all your code will be marked as obsolete, and should give you a hint on how to update your code, also the web site is completely updated to the new API, here is a list with the most used features in the library that changed:

  • IChartLegend<T> no longer requires the generic param here is an example to migrate to the new api.
  • IChartTooltip<T> no longer requires the generic param, here is an example to migrate to the new api.
  • The type of the Chart.VisualElements property, changed from ChartElement<T> to ChartElement, also VisualElement<T> cchanged to VisualElement example here and here.
  • There are probably more braking changes if you are drawing directly on the canvas, please refer to the articles in the web site to see how to use the new API, in general most of the changes just removed the TDrawingContext generic param, or the object was renamed (objects were marked as obsolete and there should be a hint in your code with the new name).

For more help on breaking changes, please see #1705.

Fixed issues

Alot :( there is no list here now.

What's Changed

New Contributors

Full Changelog: v2.0.0-rc4...v2.0.0-rc5