diff --git a/.editorconfig b/.editorconfig
index 32b10a3eb..e38472d65 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -111,7 +111,7 @@ dotnet_style_prefer_conditional_expression_over_return = true:silent
csharp_prefer_simple_default_expression = true:suggestion
# Expression-bodied members
-csharp_style_expression_bodied_methods = false
+csharp_style_expression_bodied_methods = when_on_single_line:warning
csharp_style_expression_bodied_constructors = false
csharp_style_expression_bodied_operators = true:silent
csharp_style_expression_bodied_properties = true:silent
diff --git a/.github/workflows/compile-all-views.yml b/.github/workflows/compile-all-views.yml
index e3b238bfa..aa883600b 100644
--- a/.github/workflows/compile-all-views.yml
+++ b/.github/workflows/compile-all-views.yml
@@ -21,9 +21,9 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- - uses: actions/setup-dotnet@v3
+ - uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml
index 1e823bcb4..c374437a6 100644
--- a/.github/workflows/run-unit-tests.yml
+++ b/.github/workflows/run-unit-tests.yml
@@ -21,14 +21,11 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- - uses: actions/setup-dotnet@v3
+ - uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- - name: Install MAUI workload
- run: dotnet workload install maui
-
- name: Run unit tests
run: dotnet test ./tests/LiveChartsCore.UnitTesting
diff --git a/docs/LiveChartsCore.SkiaSharpView.Avalonia.xml b/docs/LiveChartsCore.SkiaSharpView.Avalonia.xml
deleted file mode 100644
index ab66db036..000000000
--- a/docs/LiveChartsCore.SkiaSharpView.Avalonia.xml
+++ /dev/null
@@ -1,1135 +0,0 @@
-
-
-
- LiveChartsCore.SkiaSharpView.Avalonia
-
-
-
-
-
-
-
- The core
-
-
-
-
- The legend
-
-
-
-
- The tooltip
-
-
-
-
- Initializes a new instance of the class.
-
- Default colors are not valid
-
-
-
- The draw margin property
-
-
-
-
- The series property
-
-
-
-
- The x axes property
-
-
-
-
- The y axes property
-
-
-
-
- The zoom mode property
-
-
-
-
- The zooming speed property
-
-
-
-
- The animations speed property
-
-
-
-
- The easing function property
-
-
-
-
- The tool tip template property
-
-
-
-
- The tool tip position property
-
-
-
-
- The tool tip finding strategy property
-
-
-
-
- The tool tip font family property
-
-
-
-
- The tool tip font size property
-
-
-
-
- The tool tip font weight property
-
-
-
-
- The tool tip font style property
-
-
-
-
- The tool tip text brush property
-
-
-
-
- The tool tip background property
-
-
-
-
- The legend position property
-
-
-
-
- The legend orientation property
-
-
-
-
- The legend template property
-
-
-
-
- The legend font family property
-
-
-
-
- The legend font size property
-
-
-
-
- The legend font weight property
-
-
-
-
- The legend font style property
-
-
-
-
- The legend text brush property
-
-
-
-
- The legend background property
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets or sets the tool tip data template.
-
-
- The tool tip template.
-
-
-
-
- Gets or sets the tool tip default font family.
-
-
- The tool tip font family.
-
-
-
-
- Gets or sets the default size of the tool tip font.
-
-
- The size of the tool tip font.
-
-
-
-
- Gets or sets the tool tip default font weight.
-
-
- The tool tip font weight.
-
-
-
-
- Gets or sets the tool tip default font style.
-
-
- The tool tip font style.
-
-
-
-
- Gets or sets the tool tip default text brush.
-
-
- The tool tip text brush.
-
-
-
-
- Gets or sets the tool tip default background.
-
-
- The tool tip background.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets or sets the legend template.
-
-
- The legend template.
-
-
-
-
- Gets or sets the legend default font family.
-
-
- The legend font family.
-
-
-
-
- Gets or sets the size of the legend default font.
-
-
- The size of the legend font.
-
-
-
-
- Gets or sets the legend default font weight.
-
-
- The legend font weight.
-
-
-
-
- Gets or sets the legend default font style.
-
-
- The legend font style.
-
-
-
-
- Gets or sets the legend default text brush.
-
-
- The legend text brush.
-
-
-
-
- Gets or sets the legend default background.
-
-
- The legend background.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Initializes the core.
-
-
-
-
-
-
-
-
- Defines a default legend for a chart.
-
-
-
-
- Initializes a new instance of the class.
-
- default template not found
-
-
-
- The orientation property
-
-
-
-
- The dock property
-
-
-
-
- Gets or sets the custom template.
-
-
- The custom template.
-
-
-
-
- Gets or sets the series.
-
-
- The series.
-
-
-
-
- Gets or sets the text brush.
-
-
- The text brush.
-
-
-
-
- Gets or sets the orientation.
-
-
- The orientation.
-
-
-
-
- Gets or sets the dock.
-
-
- The dock.
-
-
-
-
- Builds the content.
-
-
-
-
- Defines a default tool tip for a chart control.
-
-
-
-
- Initializes a new instance of the class.
-
- default template not found
-
-
-
- Gets or sets the tool tip template.
-
-
- The tool tip template.
-
-
-
-
- Gets or sets the points.
-
-
- The points.
-
-
-
-
- Gets or sets the tool tip font family.
-
-
- The tool tip font family.
-
-
-
-
- Gets or sets the size of the tool tip font.
-
-
- The size of the tool tip font.
-
-
-
-
- Gets or sets the tool tip font weight.
-
-
- The tool tip font weight.
-
-
-
-
- Gets or sets the tool tip font style.
-
-
- The tool tip font style.
-
-
-
-
- Gets or sets the tool tip text brush.
-
-
- The tool tip text brush.
-
-
-
-
- Gets or sets the tooltip background.
-
-
- The tooltip background.
-
-
-
-
- Builds the content.
-
-
-
-
-
- Defines a chart only for the avalonia ui framework
-
-
-
-
- Gets or sets the tool tip template.
-
-
- The tool tip template.
-
-
-
-
- Gets or sets the tool tip font family.
-
-
- The tool tip font family.
-
-
-
-
- Gets or sets the size of the tool tip font.
-
-
- The size of the tool tip font.
-
-
-
-
- Gets or sets the tool tip font weight.
-
-
- The tool tip font weight.
-
-
-
-
- Gets or sets the tool tip font style.
-
-
- The tool tip font style.
-
-
-
-
- Gets or sets the tool tip text brush.
-
-
- The tool tip text brush.
-
-
-
-
- Gets or sets the tool tip background.
-
-
- The tool tip background.
-
-
-
-
- Gets or sets the legend template.
-
-
- The legend template.
-
-
-
-
- Gets or sets the legend font family.
-
-
- The legend font family.
-
-
-
-
- Gets or sets the size of the legend font.
-
-
- The size of the legend font.
-
-
-
-
- Gets or sets the legend font weight.
-
-
- The legend font weight.
-
-
-
-
- Gets or sets the legend font style.
-
-
- The legend font style.
-
-
-
-
- Gets or sets the legend text brush.
-
-
- The legend text brush.
-
-
-
-
- Gets or sets the legend background.
-
-
- The legend background.
-
-
-
-
- The legend binding context.
-
-
-
-
- Gets or sets the series.
-
-
- The series.
-
-
-
-
- Gets or sets the font family.
-
-
- The font family.
-
-
-
-
- Gets or sets the size of the font.
-
-
- The size of the font.
-
-
-
-
- Gets or sets the font weight.
-
-
- The font weight.
-
-
-
-
- Gets or sets the font style.
-
-
- The font style.
-
-
-
-
- Gets or sets the text brush.
-
-
- The text brush.
-
-
-
-
- Gets or sets the background.
-
-
- The background.
-
-
-
-
- The motion canvas control for avalonia, .
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- The paint tasks property
-
-
-
-
- The back color property
-
-
-
-
- Gets or sets the paint tasks.
-
-
- The paint tasks.
-
-
-
-
- Gets or sets the frames per second.
-
-
- The frames per second.
-
-
-
-
- Gets or sets the color of the back.
-
-
- The color of the back.
-
-
-
-
- Gets the canvas core.
-
-
- The canvas core.
-
-
-
-
-
-
-
-
-
-
-
-
-
- The core
-
-
-
-
- The legend
-
-
-
-
- The tooltip
-
-
-
-
- Initializes a new instance of the class.
-
- Default colors are not valid
-
-
-
- The draw margin property
-
-
-
-
- The series property
-
-
-
-
- The initial rotation property
-
-
-
-
- The maximum angle property
-
-
-
-
- The total property
-
-
-
-
- The animations speed property
-
-
-
-
- The easing function property
-
-
-
-
- The tool tip template property
-
-
-
-
- The tool tip position property
-
-
-
-
- The tool tip finding strategy property
-
-
-
-
- The tool tip font family property
-
-
-
-
- The tool tip font size property
-
-
-
-
- The tool tip font weight property
-
-
-
-
- The tool tip font style property
-
-
-
-
- The tool tip text brush property
-
-
-
-
- The tool tip background property
-
-
-
-
- The legend position property
-
-
-
-
- The legend orientation property
-
-
-
-
- The legend template property
-
-
-
-
- The legend font family property
-
-
-
-
- The legend font size property
-
-
-
-
- The legend font weight property
-
-
-
-
- The legend font style property
-
-
-
-
- The legend text brush property
-
-
-
-
- The legend background property
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets or sets the tool data tip template.
-
-
- The tool tip template.
-
-
-
-
- Gets or sets the tool tip default font family.
-
-
- The tool tip font family.
-
-
-
-
- Gets or sets the default size of the tool tip font.
-
-
- The size of the tool tip font.
-
-
-
-
- Gets or sets the default tool tip font weight.
-
-
- The tool tip font weight.
-
-
-
-
- Gets or sets the default tool tip font style.
-
-
- The tool tip font style.
-
-
-
-
- Gets or sets the default tool tip text brush.
-
-
- The tool tip text brush.
-
-
-
-
- Gets or sets the default tool tip background.
-
-
- The tool tip background.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets or sets the legend template.
-
-
- The legend template.
-
-
-
-
- Gets or sets the default legend font family.
-
-
- The legend font family.
-
-
-
-
- Gets or sets the default size of the legend font.
-
-
- The size of the legend font.
-
-
-
-
- Gets or sets the default legend font weight.
-
-
- The legend font weight.
-
-
-
-
- Gets or sets the default legend font style.
-
-
- The legend font style.
-
-
-
-
- Gets or sets the default legend text brush.
-
-
- The legend text brush.
-
-
-
-
- Gets or sets the default legend background.
-
-
- The legend background.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Initializes the core.
-
-
-
-
-
-
-
-
- Defines the tool tip binding context.
-
-
-
-
- Gets or sets the points.
-
-
- The points.
-
-
-
-
- Gets or sets the tool tip font family.
-
-
- The tool tip font family.
-
-
-
-
- Gets or sets the size of the tool tip font.
-
-
- The size of the tool tip font.
-
-
-
-
- Gets or sets the tool tip font weight.
-
-
- The tool tip font weight.
-
-
-
-
- Gets or sets the tool tip font style.
-
-
- The tool tip font style.
-
-
-
-
- Gets or sets the tool tip text brush.
-
-
- The tool tip text brush.
-
-
-
-
- Gets or sets the tool tip background.
-
-
- The tool tip background.
-
-
-
-
diff --git a/docs/LiveChartsCore.SkiaSharpView.WPF.xml b/docs/LiveChartsCore.SkiaSharpView.WPF.xml
deleted file mode 100644
index 9657c6eb7..000000000
--- a/docs/LiveChartsCore.SkiaSharpView.WPF.xml
+++ /dev/null
@@ -1,730 +0,0 @@
-
-
-
- LiveChartsCore.SkiaSharpView.WPF
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- The series property
-
-
-
-
- The x axes property
-
-
-
-
- The y axes property
-
-
-
-
- The zoom mode property
-
-
-
-
- The zooming speed property
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Initializes the core.
-
- canvas not found
-
-
-
-
-
-
- The core
-
-
-
-
- The canvas
-
-
-
-
- The legend
-
-
-
-
- The tool tip
-
-
-
-
- Initializes a new instance of the class.
-
- Default colors are not valid
-
-
-
- The draw margin property
-
-
-
-
- The animations speed property
-
-
-
-
- The easing function property
-
-
-
-
- The legend position property
-
-
-
-
- The legend orientation property
-
-
-
-
- The tool tip position property
-
-
-
-
- The tool tip finding strategy property
-
-
-
-
- The tool tip background property
-
-
-
-
- The tool tip font family property
-
-
-
-
- The tool tip text color property
-
-
-
-
- The tool tip font size property
-
-
-
-
- The tool tip font weight property
-
-
-
-
- The tool tip font stretch property
-
-
-
-
- The tool tip font style property
-
-
-
-
- The tool tip template property
-
-
-
-
- The legend font family property
-
-
-
-
- The legend text color property
-
-
-
-
- The legend font size property
-
-
-
-
- The legend font weight property
-
-
-
-
- The legend font stretch property
-
-
-
-
- The legend font style property
-
-
-
-
- The legend template property
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets or sets the tool tip template.
-
-
- The tool tip template.
-
-
-
-
- Gets or sets the default tool tip background.
-
-
- The tool tip background.
-
-
-
-
- Gets or sets the default tool tip font family.
-
-
- The tool tip font family.
-
-
-
-
- Gets or sets the default color of the tool tip text.
-
-
- The color of the tool tip text.
-
-
-
-
- Gets or sets the default size of the tool tip font.
-
-
- The size of the tool tip font.
-
-
-
-
- Gets or sets the default tool tip font weight.
-
-
- The tool tip font weight.
-
-
-
-
- Gets or sets the default tool tip font stretch.
-
-
- The tool tip font stretch.
-
-
-
-
- Gets or sets the default tool tip font style.
-
-
- The tool tip font style.
-
-
-
-
-
-
-
- Gets or sets the legend template.
-
-
- The legend template.
-
-
-
-
- Gets or sets the default legend font family.
-
-
- The legend font family.
-
-
-
-
- Gets or sets the default color of the legend text.
-
-
- The color of the legend text.
-
-
-
-
- Gets or sets the default size of the legend font.
-
-
- The size of the legend font.
-
-
-
-
- Gets or sets the default legend font weight.
-
-
- The legend font weight.
-
-
-
-
- Gets or sets the default legend font stretch.
-
-
- The legend font stretch.
-
-
-
-
- Gets or sets the default legend font style.
-
-
- The legend font style.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Initializes the core.
-
-
-
-
-
- Called when a dependency property changes.
-
- The o.
- The instance containing the event data.
-
-
-
-
- Sets the local value of a dependency property, specified by its dependency property identifier.
- If the object has not yet finished initializing, does so without changing its value source.
-
- The identifier of the dependency property to set.
- The new local value.
-
-
-
-
- DefaultLegend
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- The custom template property
-
-
-
-
- The series property
-
-
-
-
- The orientation property
-
-
-
-
- The dock property
-
-
-
-
- The text color property
-
-
-
-
- Gets or sets the series.
-
-
- The series.
-
-
-
-
- Gets or sets the custom template.
-
-
- The custom template.
-
-
-
-
- Gets or sets the orientation.
-
-
- The orientation.
-
-
-
-
- Gets or sets the dock.
-
-
- The dock.
-
-
-
-
- Gets or sets the color of the text.
-
-
- The color of the text.
-
-
-
-
- InitializeComponent
-
-
-
-
-
- DefaultTooltip
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- The template property
-
-
-
-
- The points property
-
-
-
-
- The background property
-
-
-
-
- The font family property
-
-
-
-
- The font size property
-
-
-
-
- The font weight property
-
-
-
-
- The font style property
-
-
-
-
- The font stretch property
-
-
-
-
- The text color property
-
-
-
-
- Gets or sets the animations speed.
-
-
- The animations speed.
-
-
-
-
- Gets or sets the easing function.
-
-
- The easing function.
-
-
-
-
- Gets or sets the template.
-
-
- The template.
-
-
-
-
- Gets or sets the background.
-
-
- The background.
-
-
-
-
- Gets or sets the points.
-
-
- The points.
-
-
-
-
- Gets or sets the font family.
-
-
- The font family.
-
-
-
-
- Gets or sets the size of the font.
-
-
- The size of the font.
-
-
-
-
- Gets or sets the font weight.
-
-
- The font weight.
-
-
-
-
- Gets or sets the font style.
-
-
- The font style.
-
-
-
-
- Gets or sets the font stretch.
-
-
- The font stretch.
-
-
-
-
- Gets or sets the color of the text.
-
-
- The color of the text.
-
-
-
-
- InitializeComponent
-
-
-
-
- Defines the motion canvas control for WPF, .
-
-
-
-
-
- The skia element
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- The paint tasks property
-
-
-
-
- Gets or sets the paint tasks.
-
-
- The paint tasks.
-
-
-
-
- Gets or sets the frames per second.
-
-
- The frames per second.
-
-
-
-
- Gets the canvas core.
-
-
- The canvas core.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- The series property
-
-
-
-
- The initial rotation property
-
-
-
-
- The maximum angle property
-
-
-
-
- The total property
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Initializes the core.
-
- canvas not found
-
-
-
diff --git a/docs/LiveChartsCore.SkiaSharpView.WinForms.xml b/docs/LiveChartsCore.SkiaSharpView.WinForms.xml
deleted file mode 100644
index e92254489..000000000
--- a/docs/LiveChartsCore.SkiaSharpView.WinForms.xml
+++ /dev/null
@@ -1,323 +0,0 @@
-
-
-
- LiveChartsCore.SkiaSharpView.WinForms
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
- The default tool tip control.
- The default legend control.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Initializes the core.
-
-
-
-
-
-
-
-
-
-
- The core
-
-
-
-
- The legend
-
-
-
-
- The tooltip
-
-
-
-
- The motion canvas
-
-
-
-
- Initializes a new instance of the class.
-
- The default tool tip control.
- The default legend.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets or sets the default legend font.
-
-
- The legend font.
-
-
-
-
- Gets or sets the default color of the legend back.
-
-
- The color of the legend back.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets or sets the default tool tip font.
-
-
- The tool tip font.
-
-
-
-
- Gets or sets the color of the default tool tip back.
-
-
- The color of the tool tip back.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Initializes the core.
-
-
-
-
-
- Called when a property changes.
-
-
-
-
-
- Raises the event.
-
- The instance containing the event data.
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Gets or sets the orientation.
-
-
- The orientation.
-
-
-
-
- Required designer variable.
-
-
-
-
- Clean up any resources being used.
-
- true if managed resources should be disposed; otherwise, false.
-
-
-
- Required method for Designer support - do not modify
- the contents of this method with the code editor.
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Disposes the specified disposing.
-
- if set to true [disposing].
-
-
-
-
- Gets the create parameters.
-
-
- The create parameters.
-
-
-
-
- Required designer variable.
-
-
-
-
- Required method for Designer support - do not modify
- the contents of this method with the code editor.
-
-
-
-
- The motion canvas control for windows forms, .
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Gets or sets the paint tasks.
-
-
- The paint tasks.
-
-
-
-
- Gets or sets the frames per second.
-
-
- The frames per second.
-
-
-
-
- Gets the canvas core.
-
-
- The canvas core.
-
-
-
-
- Required designer variable.
-
-
-
-
- Clean up any resources being used.
-
- true if managed resources should be disposed; otherwise, false.
-
-
-
- Required method for Designer support - do not modify
- the contents of this method with the code editor.
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
- The default tool tip control.
- The default legend.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Initializes the core.
-
-
-
-
diff --git a/docs/LiveChartsCore.SkiaSharpView.Xamarin.Forms.xml b/docs/LiveChartsCore.SkiaSharpView.Xamarin.Forms.xml
deleted file mode 100644
index 30a8bbf32..000000000
--- a/docs/LiveChartsCore.SkiaSharpView.Xamarin.Forms.xml
+++ /dev/null
@@ -1,1146 +0,0 @@
-
-
-
- LiveChartsCore.SkiaSharpView.XamarinForms
-
-
-
-
-
-
-
- The core
-
-
-
-
- Initializes a new instance of the class.
-
- Default colors are not valid
-
-
-
- The series property
-
-
-
-
- The x axes property
-
-
-
-
- The y axes property
-
-
-
-
- The draw margin property
-
-
-
-
- The zoom mode property
-
-
-
-
- The zooming speed property
-
-
-
-
- The animations speed property
-
-
-
-
- The easing function property
-
-
-
-
- The legend position property
-
-
-
-
- The legend orientation property
-
-
-
-
- The legend template property
-
-
-
-
- The legend font family property
-
-
-
-
- The legend font size property
-
-
-
-
- The legend text color property
-
-
-
-
- The legend background property
-
-
-
-
- The legend font attributes property
-
-
-
-
- The tool tip position property
-
-
-
-
- The too ltip finding strategy property
-
-
-
-
- The tool tip template property
-
-
-
-
- The tool tip font family property
-
-
-
-
- The tool tip font size property
-
-
-
-
- The tool tip text color property
-
-
-
-
- The tool tip background property
-
-
-
-
- The tool tip font attributes property
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets or sets the legend template.
-
-
- The legend template.
-
-
-
-
- Gets or sets the default legend font family.
-
-
- The legend font family.
-
-
-
-
- Gets or sets the default size of the legend font.
-
-
- The size of the legend font.
-
-
-
-
- Gets or sets the default color of the legend text.
-
-
- The color of the legend text.
-
-
-
-
- Gets or sets the default color of the legend background.
-
-
- The color of the legend background.
-
-
-
-
- Gets or sets the default legend font attributes.
-
-
- The legend font attributes.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets or sets the tool tip template.
-
-
- The tool tip template.
-
-
-
-
- Gets or sets the default tool tip font family.
-
-
- The tool tip font family.
-
-
-
-
- Gets or sets the default size of the tool tip font.
-
-
- The size of the tool tip font.
-
-
-
-
- Gets or sets the default color of the tool tip text.
-
-
- The color of the tool tip text.
-
-
-
-
- Gets or sets the default color of the tool tip background.
-
-
- The color of the tool tip background.
-
-
-
-
- Gets or sets the default tool tip font attributes.
-
-
- The tool tip font attributes.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Initializes the core.
-
-
-
-
-
- Called when a bindable property changed.
-
- The o.
- The old value.
- The new value.
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Gets or sets the legend template.
-
-
- The legend template.
-
-
-
-
- Gets or sets the series.
-
-
- The series.
-
-
-
-
- Gets or sets the font family.
-
-
- The font family.
-
-
-
-
- Gets or sets the size of the font.
-
-
- The size of the font.
-
-
-
-
- Gets or sets the color of the text.
-
-
- The color of the text.
-
-
-
-
- Gets or sets the font attributes.
-
-
- The font attributes.
-
-
-
-
- Gets or sets the orientation.
-
-
- The orientation.
-
-
-
-
- Builds the content.
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Gets or sets the tool tip template.
-
-
- The tool tip template.
-
-
-
-
- Gets or sets the points.
-
-
- The points.
-
-
-
-
- Gets or sets the font family.
-
-
- The font family.
-
-
-
-
- Gets or sets the size of the font.
-
-
- The size of the font.
-
-
-
-
- Gets or sets the color of the text.
-
-
- The color of the text.
-
-
-
-
- Gets or sets the font attributes.
-
-
- The font attributes.
-
-
-
-
- Builds the content.
-
-
-
-
-
- A converter value helper
-
-
-
-
- Implement this method to convert to by using and .
-
- The value to convert.
- The type to which to convert the value.
- A parameter to use during the conversion.
- The culture to use during the conversion.
-
- To be added.
-
-
- To be added.
-
-
-
-
- Implement this method to convert back from by using and .
-
- The value to convert.
- The type to which to convert the value.
- A parameter to use during the conversion.
- The culture to use during the conversion.
-
- To be added.
-
-
-
- To be added.
-
-
-
-
- A chart for Xamarin.
-
-
-
-
- Gets the layout grid.
-
-
- The layout grid.
-
-
-
-
- Gets the canvas.
-
-
- The canvas.
-
-
-
-
- Gets the legend.
-
-
- The legend.
-
-
-
-
- Gets or sets the tool tip template.
-
-
- The tool tip template.
-
-
-
-
- Gets or sets the tool tip font family.
-
-
- The tool tip font family.
-
-
-
-
- Gets or sets the size of the tool tip font.
-
-
- The size of the tool tip font.
-
-
-
-
- Gets or sets the color of the tool tip text.
-
-
- The color of the tool tip text.
-
-
-
-
- Gets or sets the color of the tool tip background.
-
-
- The color of the tool tip background.
-
-
-
-
- Gets or sets the tool tip font attributes.
-
-
- The tool tip font attributes.
-
-
-
-
- Gets or sets the legend template.
-
-
- The legend template.
-
-
-
-
- Gets or sets the legend font family.
-
-
- The legend font family.
-
-
-
-
- Gets or sets the size of the legend font.
-
-
- The size of the legend font.
-
-
-
-
- Gets or sets the color of the legend text.
-
-
- The color of the legend text.
-
-
-
-
- Gets or sets the color of the legend background.
-
-
- The color of the legend background.
-
-
-
-
- Gets or sets the legend font attributes.
-
-
- The legend font attributes.
-
-
-
-
- Defines the legend binding context.
-
-
-
-
- Gets or sets the series.
-
-
- The series.
-
-
-
-
- Gets or sets the font family.
-
-
- The font family.
-
-
-
-
- Gets or sets the size of the font.
-
-
- The size of the font.
-
-
-
-
- Gets or sets the color of the text.
-
-
- The color of the text.
-
-
-
-
- Gets or sets the font attributes.
-
-
- The font attributes.
-
-
-
-
- Gets or sets the orientation.
-
-
- The orientation.
-
-
-
-
- The motion canvas control fro Xamarin, .
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- The paint tasks property
-
-
-
-
- Gets the sk canvas view.
-
-
- The sk canvas view.
-
-
-
-
- Gets or sets the frames per second.
-
-
- The frames per second.
-
-
-
-
- Gets or sets the paint tasks.
-
-
- The paint tasks.
-
-
-
-
- Gets the canvas core.
-
-
- The canvas core.
-
-
-
-
- Invalidates this instance.
-
-
-
-
-
- A converter value helper
-
-
-
-
- Implement this method to convert to by using and .
-
- The value to convert.
- The type to which to convert the value.
- A parameter to use during the conversion.
- The culture to use during the conversion.
-
- To be added.
-
-
- To be added.
-
-
-
-
- Implement this method to convert back from by using and .
-
- The value to convert.
- The type to which to convert the value.
- A parameter to use during the conversion.
- The culture to use during the conversion.
-
- To be added.
-
-
-
- To be added.
-
-
-
-
-
-
-
- The core
-
-
-
-
- Initializes a new instance of the class.
-
- Default colors are not valid
-
-
-
- The series property
-
-
-
-
- The initial rotation property
-
-
-
-
- The maximum angle property
-
-
-
-
- The total property
-
-
-
-
- The draw margin property
-
-
-
-
- The animations speed property
-
-
-
-
- The easing function property
-
-
-
-
- The legend position property
-
-
-
-
- The legend orientation property
-
-
-
-
- The legend template property
-
-
-
-
- The legend font family property
-
-
-
-
- The legend font size property
-
-
-
-
- The legend text color property
-
-
-
-
- The legend background property
-
-
-
-
- The legend font attributes property
-
-
-
-
- The tool tip position property;
-
-
-
-
- The tool tip finding strategy property
-
-
-
-
- The tool tip template property
-
-
-
-
- The tool tip font family property
-
-
-
-
- The tool tip font size property
-
-
-
-
- The tool tip text color property
-
-
-
-
- The tool tip background property
-
-
-
-
- The tool tip font attributes property
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets or sets the legend template.
-
-
- The legend template.
-
-
-
-
- Gets or sets the legend font family.
-
-
- The legend font family.
-
-
-
-
- Gets or sets the size of the legend font.
-
-
- The size of the legend font.
-
-
-
-
- Gets or sets the color of the legend text.
-
-
- The color of the legend text.
-
-
-
-
- Gets or sets the color of the legend background.
-
-
- The color of the legend background.
-
-
-
-
- Gets or sets the legend font attributes.
-
-
- The legend font attributes.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets or sets the tool tip template.
-
-
- The tool tip template.
-
-
-
-
- Gets or sets the tool tip font family.
-
-
- The tool tip font family.
-
-
-
-
- Gets or sets the size of the tool tip font.
-
-
- The size of the tool tip font.
-
-
-
-
- Gets or sets the color of the tool tip text.
-
-
- The color of the tool tip text.
-
-
-
-
- Gets or sets the color of the tool tip background.
-
-
- The color of the tool tip background.
-
-
-
-
- Gets or sets the tool tip font attributes.
-
-
- The tool tip font attributes.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Initializes the core.
-
-
-
-
-
- Called when a bindable property changes.
-
- The o.
- The old value.
- The new value.
-
-
-
-
- Defines the tool tip binding context.
-
-
-
-
- Gets or sets the points.
-
-
- The points.
-
-
-
-
- Gets or sets the font family.
-
-
- The font family.
-
-
-
-
- Gets or sets the size of the font.
-
-
- The size of the font.
-
-
-
-
- Gets or sets the color of the text.
-
-
- The color of the text.
-
-
-
-
- Gets or sets the font attributes.
-
-
- The font attributes.
-
-
-
-
- A converter value helper
-
-
-
-
- Implement this method to convert to by using and .
-
- The value to convert.
- The type to which to convert the value.
- A parameter to use during the conversion.
- The culture to use during the conversion.
-
- To be added.
-
-
- To be added.
-
-
-
-
- Implement this method to convert back from by using and .
-
- The value to convert.
- The type to which to convert the value.
- A parameter to use during the conversion.
- The culture to use during the conversion.
-
- To be added.
-
-
-
- To be added.
-
-
-
-
diff --git a/docs/LiveChartsCore.SkiaSharpView.xml b/docs/LiveChartsCore.SkiaSharpView.xml
deleted file mode 100644
index cdcbd5717..000000000
--- a/docs/LiveChartsCore.SkiaSharpView.xml
+++ /dev/null
@@ -1,1599 +0,0 @@
-
-
-
- LiveChartsCore.SkiaSharpView
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Defines a column series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
-
-
- Defines a column series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
-
-
- Defines a column series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
- The type of the data label of every point.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Defines an avalonia-skiasharp drawing context.
-
-
-
-
-
- Initializes a new instance of the class.
-
- The motion canvas.
- The information.
- The surface.
- The canvas.
-
-
-
- Gets or sets the color of the back.
-
-
- The color of the back.
-
-
-
-
- Clears the canvas.
-
-
-
-
-
-
-
-
-
-
- Defines a circle geometry.
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The opacity property
-
-
-
-
- The x
-
-
-
-
- The y
-
-
-
-
- The rotation
-
-
-
-
- The has custom transform
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
-
-
-
- Gets or sets the matrix transform.
-
-
- The transform.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Draws the geometry in the user interface.
-
- The context.
-
-
-
- Called when the geometry is drawn.
-
- The context.
- The paint.
-
-
-
- Measures the geometry.
-
- The drawable task.
- the size of the geometry.
-
-
-
- Called before the draw.
-
-
-
-
- Called after the draw.
-
-
-
-
- Called when the geometry is measured.
-
- The paint task.
- the size of the geometry
-
-
-
- Gets the actual transform.
-
-
-
-
-
- Gets the position of the geometry from the top left corner of the view.
-
- The context.
- The paint.
- the position.
-
-
-
- Gets the highlitable geometry.
-
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Gets or sets the vertical align.
-
-
- The vertical align.
-
-
-
-
- Gets or sets the horizontal align.
-
-
- The horizontal align.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Defines an oval geometry.
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Defines a rectangle geometry.
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
- Defines a rounded rectangle geometry.
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Gets or sets the rx, the rounding in the x axis.
-
-
- The rx.
-
-
-
-
- Gets or sets the ry, the rounding in the axis.
-
-
- The ry.
-
-
-
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The width
-
-
-
-
- The height
-
-
-
-
- The match dimensions
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Defines a square geometry.
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
- Defines a geometry that is built using from a svg path.
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- The SVG path.
-
-
-
- Gets or sets the SVG path.
-
-
- The SVG.
-
-
-
-
-
-
-
- Defines a skia sharp drawing context.
-
-
-
-
-
- Initializes a new instance of the class.
-
- The motion canvas.
- The information.
- The surface.
- The canvas.
-
-
-
- Gets or sets the motion canvas.
-
-
- The motion canvas.
-
-
-
-
- Gets or sets the information.
-
-
- The information.
-
-
-
-
- Gets or sets the surface.
-
-
- The surface.
-
-
-
-
- Gets or sets the canvas.
-
-
- The canvas.
-
-
-
-
- Gets or sets the paint task.
-
-
- The paint task.
-
-
-
-
- Gets or sets the paint.
-
-
- The paint.
-
-
-
-
- Clears the canvas.
-
-
-
-
- Defines a helper class to build gauges.
-
-
-
-
- Gets or sets the inner radius, setting this property to null will let the theme decide the value, default is null.
-
-
- The inner radius.
-
-
-
-
- Gets or sets the offset radius, the separation between each gauge if multiple gauges are nested,
- setting this property to null will let the theme decide the value, default is null.
-
-
- The relative inner radius.
-
-
-
-
- Gets or sets the maximum width of the radial column, setting this property to null will let the theme decide the value, default is null.
-
-
- The maximum width of the radial column.
-
-
-
-
- Gets or sets the corner radius, setting this property to null will let the theme decide the value, default is null.
-
-
- The corner radius.
-
-
-
-
- Gets or sets the inner radius, setting this property to null will let the theme decide the value, default is null.
-
-
- The inner radius.
-
-
-
-
- Gets or sets the background inner radius, setting this property to null will let the theme decide the value, default is null.
-
-
- The background inner radius.
-
-
-
-
- Gets or sets the background offset radius, the separation between each gauge if multiple gauges are nested,
- setting this property to null will let the theme decide the value, default is null.
-
-
- The background relative inner radius.
-
-
-
-
- Gets or sets the width of the background maximum radial column, setting this property to null will let the theme
- decide the value, default is null.
-
-
- The width of the background maximum radial column.
-
-
-
-
- Gets or sets the background corner radius, setting this property to null will let the theme decide the value, default is null.
-
-
- The background corner radius.
-
-
-
-
- Gets or sets the background, setting this property to will let the theme decide
- the value, default is .
-
-
- The background.
-
-
-
-
- Gets or sets the size of the labels, setting this property to null will let the theme decide the value, default is null.
-
-
- The size of the labels.
-
-
-
-
- Gets or sets the labels position, setting this property to null will let the theme decide the value, default is null.
-
-
- The labels position.
-
-
-
-
- Gets or sets the label formatter.
-
-
- The label formatter.
-
-
-
-
- Adds the value.
-
- The value.
- The series name.
- The series drawable task.
- The labels drawable task.
-
-
-
-
- Adds the value.
-
- The value.
- The series name.
- Color of the series.
- Color of the labels.
-
-
-
-
- Adds the value.
-
- The value.
-
-
-
-
- Adds the value.
-
- The value.
- The series name.
-
-
-
-
- Builds the series.
-
-
-
-
-
- Applies the styles the specified series.
-
- The series.
-
-
-
-
- Applies the styles to fill series.
-
- The series.
-
-
-
-
- Applies the styles to series.
-
- The series.
-
-
-
-
-
- Defines a line series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
-
-
- Defines a line series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
-
-
- Defines a line series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
- The type of the data label of every point.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Defines the default LiveCharts-SkiaSharp settings
-
-
-
-
- Gets the default paint task.
-
-
- The default paint.
-
-
-
-
- Gets the default platform builder.
-
-
- The default platform builder.
-
-
-
-
- Adds SkiaSharp as the UI provider for LiveCharts.
-
- The settings.
-
-
-
-
- Adds the light theme.
-
- The settings.
- the additional styles.
-
-
-
-
- Adds the light theme.
-
- The settings.
- The additional styles.
-
-
-
-
- Adds the default resolvers.
-
- The theme.
-
-
-
-
- Adds the default resolvers.
-
- The theme.
-
-
-
-
- Converts a to a instance.
-
- The color.
- The alpha overrides.
-
-
-
-
- Creates a new color based on the
-
- The color.
- The opacity from 0 to 255.
-
-
-
-
- Creates a stroke dash effect.
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
- A wrapper object for skia sharp path effects.
-
-
-
-
-
- Gets or sets the sk path effect.
-
-
- The sk path effect.
-
-
-
-
- Creates the path effect.
-
- The drawing context.
-
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
-
-
-
- Defines a set of geometries that will be painted using a linear gradient shader.
-
-
-
-
-
- Initializes a new instance of the class.
-
- The gradient stops.
-
- The start point, both X and Y in the range of 0 to 1, where 0 is the start of the axis and 1 the end.
-
-
- The end point, both X and Y in the range of 0 to 1, where 0 is the start of the axis and 1 the end.
-
-
- An array of integers in the range of 0 to 1.
- These integers indicate the relative positions of the colors, You can set that argument to null to equally
- space the colors, default is null.
-
-
- The shader tile mode, default is .
-
-
-
-
- Initializes a new instance of the class.
-
- The gradient stops.
-
-
-
- Initializes a new instance of the class.
-
- The start color.
- The end color.
-
- The start point, both X and Y in the range of 0 to 1, where 0 is the start of the axis and 1 the end.
-
-
- The end point, both X and Y in the range of 0 to 1, where 0 is the start of the axis and 1 the end.
-
-
-
-
- Initializes a new instance of the class.
-
- The start.
- The end.
-
-
-
- Gets or sets the path effect.
-
-
- The path effect.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
-
-
-
-
-
- The skia paint
-
-
-
-
- The stroke width transition
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- The color.
-
-
-
-
-
-
- Gets or sets the style.
-
-
- The style.
-
-
-
-
-
-
-
-
-
-
- Gets or sets a value indicating whether this instance is antialias.
-
-
- true if this instance is antialias; otherwise, false.
-
-
-
-
- Gets or sets the color.
-
-
- The color.
-
-
-
-
- Gets or sets a value indicating whether this instance is paused.
-
-
- true if this instance is paused; otherwise, false.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
-
-
- Defines a set of geometries that will be painted using a radial gradient shader.
-
-
-
-
-
- Initializes a new instance of the class.
-
- The gradient stops.
-
- The center point of the gradient, both X and Y in the range of 0 to 1, where 0 is the start of the axis and 1 the end,
- default is (0.5, 0.5).
-
-
- The radius, in the range of 0 to 1, where 1 is the minimum of both Width and Height of the chart, default is 0.5.
-
-
- An array of integers in the range of 0 to 1.
- These integers indicate the relative positions of the colors, You can set that argument to null to equally
- space the colors, default is null.
-
-
- The shader tile mode, default is .
-
-
-
-
- Initializes a new instance of the class.
-
- Color of the center.
- Color of the outer.
-
-
-
- Gets or sets the path effect.
-
-
- The path effect.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
-
-
- Defines a set of geometries that will be painted using a solid color.
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- The color.
-
-
-
- Initializes a new instance of the class.
-
- The color.
- Width of the stroke.
-
-
-
- Gets or sets the stroke cap.
-
-
- The stroke cap.
-
-
-
-
- Gets or sets the stroke join.
-
-
- The stroke join.
-
-
-
-
- Gets or sets the stroke miter.
-
-
- The stroke miter.
-
-
-
-
- Gets or sets the path effect.
-
-
- The path effect.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
-
-
- Defines a pie series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
- Defines a pie series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
- Defines a pie series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
- The type of the data label of every point.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
- Defines a row series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
- data label of every point.
-
-
-
- Defines a row series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
-
-
- Defines a row series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
- The type of the data label of every point.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Defines a scatter series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
-
-
- Defines a scatter series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
-
-
- Defines a scatter series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
- The type of the data label of every point.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Defines a stacked area series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
-
-
- Defines a stacked area series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
-
-
- Defines a stacked area series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
- The type of the data label of every point.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Defines a stacked column series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
-
-
- Defines a stacked column series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
-
-
- Defines a stacked column series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
- The type of the data label of every point.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Defines a stacked row series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
-
-
- Defines a stacked row series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
-
-
- Defines a stacked row series in the user interface.
-
-
- The type of the points, you can use any type, the library already knows how to handle the most common numeric types,
- to use a custom type, you must register the type globally
- ()
- or at the series level
- ().
-
-
- The type of the geometry of every point of the series.
-
-
- The type of the data label of every point.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
diff --git a/docs/LiveChartsCore.xml b/docs/LiveChartsCore.xml
deleted file mode 100644
index faf44b1ef..000000000
--- a/docs/LiveChartsCore.xml
+++ /dev/null
@@ -1,7672 +0,0 @@
-
-
-
- LiveChartsCore
-
-
-
-
- Defines an Axis in a Cartesian chart.
-
- The type of the drawing context.
- The type of the text geometry.
- The type of the line geometry.
-
-
-
-
-
- Get a reference to the charts that are subscribed to this axis.
-
-
-
-
- Gets a reference to the pending to delete paint tasks.
-
-
-
-
- The active separators
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Occurs when a property value changes.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Called when a property changes.
-
- Name of the property.
-
-
-
-
- Softly deletes the separator.
-
- The chart.
- The separator.
- The scale.
-
-
-
-
- Defines a bar series point.
-
- The type of the model.
- The type of the visual.
- The type of the label.
- The type of the drawing context.
-
-
-
-
-
- Initializes a new instance of the class.
-
- The properties.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Called when the paint context changes.
-
-
-
-
- Defines a Cartesian chart.
-
- The type of the drawing context.
-
-
-
-
- Initializes a new instance of the class.
-
- The view.
- The default platform configuration.
- The canvas.
-
-
-
- Gets the x axes.
-
-
- The x axes.
-
-
-
-
- Gets the y axes.
-
-
- The y axes.
-
-
-
-
- Gets the series.
-
-
- The series.
-
-
-
-
- Gets the drawable series.
-
-
- The drawable series.
-
-
-
-
- Gets or sets a value indicating whether this instance is zooming or panning.
-
-
- true if this instance is zooming or panning; otherwise, false.
-
-
-
-
- Gets the view.
-
-
- The view.
-
-
-
-
-
-
-
- Finds the points near to the specified location.
-
- The pointer position.
-
-
-
-
- Scales the specified point to the UI.
-
- The point.
- Index of the x axis.
- Index of the y axis.
-
-
-
-
- Zooms to the specified pivot.
-
- The pivot.
- The direction.
-
-
-
-
- Pans with the specified delta.
-
- The delta.
-
-
-
-
- Measures this chart.
-
-
-
-
-
- Called when the updated the throttler is unlocked.
-
-
-
-
-
- Defines a Cartesian series.
-
- The type of the model.
- The type of the visual.
- The type of the label.
- The type of the drawing context.
-
-
-
-
-
-
- Initializes a new instance of the class.
-
- The series properties.
-
-
-
-
-
-
-
-
-
- Gets or sets the data labels position.
-
-
- The data labels position.
-
-
-
-
-
-
-
-
-
-
- Deletes the series from the user interface.
-
-
-
-
-
-
- Gets the label position.
-
- The x.
- The y.
- The width.
- The height.
- Size of the label.
- The position.
- The series properties.
- if set to true [is greater than pivot].
-
-
-
-
- Defines a chart,
-
- The type of the drawing context.
-
-
-
-
- The series context
-
-
-
-
- The canvas
-
-
-
-
- The update throttler
-
-
-
-
- The control size
-
-
-
-
- The view draw margin
-
-
-
-
- The legend position
-
-
-
-
- The legend orientation
-
-
-
-
- The legend
-
-
-
-
- The tool tip position
-
-
-
-
- The tool tip finding strategy
-
-
-
-
- The tool tip
-
-
-
-
- The animations speed
-
-
-
-
- The easing function
-
-
-
-
- The draw margin size
-
-
-
-
- The draw margin location
-
-
-
-
- Initializes a new instance of the class.
-
- The canvas.
- The default platform configuration.
-
-
-
-
-
-
-
-
-
-
-
-
- Gets the measure work.
-
-
- The measure work.
-
-
-
-
- Gets or sets the theme identifier.
-
-
- The theme identifier.
-
-
-
-
- Gets or sets a value indicating whether this it is the first draw of this instance.
-
-
- true if this it is the first draw; otherwise, false.
-
-
-
-
- Gets the series context.
-
-
- The series context.
-
-
-
-
- Gets the canvas.
-
-
- The canvas.
-
-
-
-
- Gets the drawable series.
-
-
- The drawable series.
-
-
-
-
- Gets the view.
-
-
- The view.
-
-
-
-
- Gets the size of the control.
-
-
- The size of the control.
-
-
-
-
- Gets the draw margin location.
-
-
- The draw margin location.
-
-
-
-
- Gets the size of the draw margin.
-
-
- The size of the draw margin.
-
-
-
-
- Gets the legend position.
-
-
- The legend position.
-
-
-
-
- Gets the legend orientation.
-
-
- The legend orientation.
-
-
-
-
- Gets the legend.
-
-
- The legend.
-
-
-
-
- Gets the tooltip position.
-
-
- The tooltip position.
-
-
-
-
- Gets the tooltip finding strategy.
-
-
- The tooltip finding strategy.
-
-
-
-
- Gets the tooltip.
-
-
- The tooltip.
-
-
-
-
- Gets the animations speed.
-
-
- The animations speed.
-
-
-
-
- Gets the easing function.
-
-
- The easing function.
-
-
-
-
-
-
-
- Measures this chart.
-
-
-
-
-
- Called when the updated the throttler is unlocked.
-
-
-
-
-
- Finds the points near to the specified point.
-
- The pointer position.
-
-
-
-
- Sets the draw margin.
-
- Size of the control.
- The margin.
-
-
-
-
- Invokes the event.
-
-
-
-
-
- Invokes the on update started.
-
-
-
-
-
- Invokes the on update finished.
-
-
-
-
-
- Implementation of a dynamic data collection based on generic Collection<T>,
- implementing INotifyCollectionChanged to notify listeners
- when items get added, removed or the whole list is refreshed.
-
-
-
-
- Initializes a new instance of ObservableCollection that is empty and has default initial capacity.
-
-
-
-
- Initializes a new instance of the ObservableCollection class that contains
- elements copied from the specified collection and has sufficient capacity
- to accommodate the number of elements copied.
-
- The collection whose elements are copied to the new list.
-
- The elements are copied onto the ObservableCollection in the
- same order they are read by the enumerator of the collection.
-
- collection is a null reference
-
-
-
- Initializes a new instance of the ObservableCollection class
- that contains elements copied from the specified list
-
- The list whose elements are copied to the new list.
-
- The elements are copied onto the ObservableCollection in the
- same order they are read by the enumerator of the list.
-
- list is a null reference
-
-
-
- ...
-
-
-
-
- Gets or sets a value indicating whether this collection acts as a ,
- disallowing duplicate items, based on .
- This might indeed consume background performance, but in the other hand,
- it will pay off in UI performance as less required UI updates are required.
-
-
-
-
- Adds the elements of the specified collection to the end of the .
-
-
- The collection whose elements should be added to the end of the .
- The collection itself cannot be null, but it can contain elements that are null, if type T is a reference type.
-
- is null.
-
-
-
- Inserts the elements of a collection into the at the specified index.
-
- The zero-based index at which the new elements should be inserted.
- The collection whose elements should be inserted into the list.
- The collection itself cannot be null, but it can contain elements that are null, if type T is a reference type.
-
- is null.
- is not in the collection range.
-
-
-
- Removes the first occurrence of each item in the specified collection from the .
-
- The items to remove.
- is null.
-
-
-
- Iterates over the collection and removes all items that satisfy the specified match.
-
- The complexity is O(n).
-
- Returns the number of elements that where
- is null.
-
-
-
- Iterates over the specified range within the collection and removes all items that satisfy the specified match.
-
- The complexity is O(n).
- The index of where to start performing the search.
- The number of items to iterate on.
-
- Returns the number of elements that where
- is out of range.
- is out of range.
- is null.
-
-
-
- Removes a range of elements from the >.
-
- The zero-based starting index of the range of elements to remove.
- The number of elements to remove.
- The specified range is exceeding the collection.
-
-
-
- Clears the current collection and replaces it with the specified collection,
- using .
-
- The items to fill the collection with, after clearing it.
- is null.
-
-
-
- Removes the specified range and inserts the specified collection in its position, leaving equal items in equal positions intact.
-
- The index of where to start the replacement.
- The number of items to be replaced.
- The collection to insert in that location.
- is out of range.
- is out of range.
- is null.
-
-
-
- Called by base class Collection<T> when the list is being cleared;
- raises a CollectionChanged event to any listeners.
-
-
-
-
-
-
-
-
-
-
- Raise CollectionChanged event to any listeners.
- Properties/methods modifying this ObservableCollection will raise
- a collection changed event through this virtual method.
-
-
- When overriding this method, either call its base implementation
-
-
-
-
-
-
-
-
-
-
- Helper to raise Count property and the Indexer property.
-
-
-
-
- /// Helper to raise a PropertyChanged event for the Indexer property
- ///
-
-
-
- Helper to raise CollectionChanged event to any listeners
-
-
-
-
- Helper to raise CollectionChanged event with action == Reset to any listeners
-
-
-
-
- Helper to raise event for clustered action and clear cluster.
-
- The index of the item following the replacement block.
-
-
-
-
-
- To be kept outside , since otherwise, a new instance will be created for each generic type used.
-
-
-
-
- Defines a column series.
-
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Defines a date time point for the Cartesian coordinate system that implements .
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- The date time.
- The value.
-
-
-
- Gets or sets the date time.
-
-
- The date time.
-
-
-
-
- Gets or sets the value.
-
-
- The value.
-
-
-
-
- Occurs when a property value changes.
-
-
-
-
-
- Called when a property changed.
-
- Name of the property.
-
-
-
- Defines a date time point for the Cartesian coordinate system that implements .
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- The date time.
- The value.
-
-
-
- Gets or sets the date time.
-
-
- The date time.
-
-
-
-
- Gets or sets the value.
-
-
- The value.
-
-
-
-
- Occurs when a property value changes.
-
-
-
-
-
- Called when a property changed.
-
- Name of the property.
-
-
-
- Defines a point for the Cartesian coordinate system that implements .
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- The x coordinate.
- The y coordinate.
-
-
-
- Gets or sets the x coordinate.
-
-
- The x.
-
-
-
-
- Gets or sets the y coordinate.
-
-
- The y.
-
-
-
-
- Occurs when a property value changes.
-
-
-
-
-
- Called when a property changed.
-
- Name of the property.
-
-
-
- Defines a point for he Cartesian coordinate system that implements .
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- The x coordinate.
- The y coordinate.
-
-
-
- Gets or sets the x coordinate.
-
-
- The x.
-
-
-
-
- Gets or sets the y coordinate.
-
-
- The y.
-
-
-
-
- Occurs when a property value changes.
-
-
-
-
-
- Called when a property changes.
-
- Name of the property.
-
-
-
- Defines an object that notifies when the value property changes.
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- The value.
-
-
-
- Gets or sets the value.
-
-
- The value.
-
-
-
-
- Occurs when a property value changes.
-
-
-
-
-
- Called when am property changed.
-
- Name of the property.
-
-
-
- Defines an object that notifies when the value property changes.
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- The value.
-
-
-
- Gets or sets the value.
-
-
- The value.
-
-
-
-
- Occurs when a property value changes.
-
-
-
-
-
- Called when a property changes.
-
- Name of the property.
-
-
-
- Defines a point with a weighted coordinate.
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- The x.
- The y.
- The weight.
-
-
-
- Gets or sets the x.
-
-
- The x.
-
-
-
-
- Gets or sets the y.
-
-
- The y.
-
-
-
-
- Gets or sets the weight.
-
-
- The weight.
-
-
-
-
- Occurs when a property value changes.
-
-
-
-
-
- Called when a property changed.
-
- Name of the property.
-
-
-
- Defines a point with a weighted coordinate.
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- The x.
- The y.
- The weight.
-
-
-
- Gets or sets the x.
-
-
- The x.
-
-
-
-
- Gets or sets the y.
-
-
- The y.
-
-
-
-
- Gets or sets the weight.
-
-
- The weight.
-
-
-
-
- Occurs when a property value changes.
-
-
-
-
-
- Called when a property changed.
-
- Name of the property.
-
-
-
- Defines a data series that has at least a to draw the data in the user interface.
-
- The type of the model.
- The type of the visual.
- The type of the label.
- The type of the drawing context.
-
-
-
-
-
- The paint context.
-
-
-
-
- The pending to delete tasks.
-
-
-
-
- Initializes a new instance of the class.
-
- The properties.
-
-
-
- Gets or sets the stroke.
-
-
- The stroke.
-
-
-
-
- Gets or sets the fill.
-
-
- The fill.
-
-
-
-
- Gets or sets the data labels drawable task.
-
-
- The data labels drawable task.
-
-
-
-
- Gets or sets the size of the data labels.
-
-
- The size of the data labels.
-
-
-
-
- Gets or sets the data labels padding.
-
-
- The data labels padding.
-
-
-
-
- Gets the default paint context.
-
-
- The default paint context.
-
-
-
-
- Gets or sets the size of the legend shape.
-
-
- The size of the legend shape.
-
-
-
-
- Releases unmanaged and - optionally - managed resources.
-
-
-
-
-
- Called when the paint context changed.
-
-
-
-
-
- Initializes the series.
-
-
- Default colors are not valid
-
-
-
- Defines the drawing alignment.
-
-
-
-
- Aligns to the start
-
-
-
-
- Aligns to the end
-
-
-
-
- Aligns to the middle
-
-
-
-
-
-
-
- The transition properties
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Invalidates this animatable.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Registers a motion property.
-
-
- The transition.
-
-
-
-
- Sets the current time.
-
- The time.
-
-
-
-
- Gets the current time.
-
-
-
-
-
- Defines the padding measure helped class,.
-
-
-
-
- The default padding.
-
-
-
-
- Gets or sets the left.
-
-
- The left.
-
-
-
-
- Gets or sets the right.
-
-
- The right.
-
-
-
-
- Gets or sets the top.
-
-
- The top.
-
-
-
-
- Gets or sets the bottom.
-
-
- The bottom.
-
-
-
-
- The Transition builder class helps to build transitions using fluent syntax.
-
-
-
-
- Initializes a new instance of the class.
-
- The target.
- The properties.
-
-
-
- Sets the animation.
-
- The animation.
- The transition
-
-
-
- Sets the animation.
-
- The animation builder.
- The transition
-
-
-
- Sets the current transitions.
-
- The transition
-
-
-
- Defines an animation.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- The easing function.
- The duration.
-
-
-
- Initializes a new instance of the class.
-
- The easing function.
- The duration.
- The repeat times.
-
-
-
- Initializes a new instance of the class.
-
- The easing function.
- The duration.
- The repeat times.
-
-
-
- Initializes a new instance of the class.
-
- The animation.
-
-
-
- Gets or sets the easing function.
-
-
-
-
- Gets or sets the duration of the transition in Milliseconds.
-
-
-
-
- Gets or sets how many times the animation needs to repeat before it is completed,
- use int.MaxValue to repeat it indefinitely number of times.
-
-
-
-
- Sets the easing function.
-
- The easing.
- The animation instance
-
-
-
- Sets the duration.
-
- The duration.
- The animation instance
-
-
-
- Sets the duration.
-
- The duration.
- The animation instance
-
-
-
- Sets the repeats times.
-
- The times.
- The animation instance
-
-
-
- Sets he repeats times indefinitely number of times.
-
- The animation instance
-
-
-
- Defines an axis visual separator.
-
- The type of the drawing context.
-
-
-
- Gets or sets the value.
-
-
- The value.
-
-
-
-
- Gets or sets the text.
-
-
- The text.
-
-
-
-
- Gets or sets the line.
-
-
- The line.
-
-
-
-
- Defines a context that is able to draw 2D shapes in the user interface.
-
-
-
-
- Clears the canvas.
-
-
-
-
- Defines an object that can is able to animate its properties.
-
-
-
-
- Gets or sets a value indicating whether this instance is completed.
-
-
- true if this instance is completed; otherwise, false.
-
-
-
-
- Gets or sets the current time.
-
-
- The current time.
-
-
-
-
- Gets or sets a value indicating whether the element is removed when all the transitions complete.
-
-
- true if remove on completed; otherwise, false.
-
-
-
-
- Sets the properties transitions.
-
- The animation.
- Name of the property.
-
-
-
- Removes a property transition.
-
- Name of the property.
-
-
-
- Removes all the current transitions.
-
-
-
-
- Completes all transitions.
-
-
-
-
- Completes the transitions.
-
- Name of the property.
-
-
-
- Gets the transition property.
-
- Name of the property.
-
-
-
-
- Defiens an animable bezier segment.
-
-
-
-
-
- Gets or sets the x0.
-
-
- The x0.
-
-
-
-
- Gets or sets the y0.
-
-
- The y0.
-
-
-
-
- Gets or sets the x1.
-
-
- The x1.
-
-
-
-
- Gets or sets the y1.
-
-
- The y1.
-
-
-
-
- Gets or sets the x2.
-
-
- The x2.
-
-
-
-
- Gets or sets the y2.
-
-
- The y2.
-
-
-
-
- Defiens a bezier segment.
-
- The type of the path context.
-
-
-
-
-
- Defines a doughnut geometry.
-
- The type of the drawing context.
-
-
-
-
- Gets or sets the center x.
-
-
- The center x.
-
-
-
-
- Gets or sets the center y.
-
-
- The center y.
-
-
-
-
- Gets or sets the width.
-
-
- The width.
-
-
-
-
- Gets or sets the height.
-
-
- The height.
-
-
-
-
- Gets or sets the start angle.
-
-
- The start angle.
-
-
-
-
- Gets or sets the sweep angle.
-
-
- The sweep angle.
-
-
-
-
- Gets or sets the push out.
-
-
- The push out.
-
-
-
-
- Gets or sets the inner radius.
-
-
- The inner radius.
-
-
-
-
- Gets or sets the corner radius.
-
-
- The corner radius.
-
-
-
-
- Gets or sets a value indicating whether the direction of the corner radius is inverted.
-
-
- true if the direction is inverted; otherwise, false.
-
-
-
-
- Defines a douggnut visual chart point.
-
- The type of the drawing context.
-
-
-
-
-
- Defines a drawable object, an object that can be represented in the user interface.
-
- The type of the drawing context.
-
-
-
-
- Draws the instance in the user interface with for the specified context.
-
- The context.
-
-
-
- Defines a set of geometries that will be drawn according to this instance specifications.
-
- The type of the drawing context.
-
-
-
- Gets or sets a value indicating whether this instance is stroke.
-
-
- true if this instance is stroke; otherwise, false.
-
-
-
-
- Gets or sets a value indicating whether this instance is fill.
-
-
- true if this instance is fill; otherwise, false.
-
-
-
-
- Gets or sets the index of the z.
-
-
- The index of the z.
-
-
-
-
- Gets or sets the stroke thickness.
-
-
- The stroke thickness.
-
-
-
-
- Gets or sets a value indicating whether this instance is paused.
-
-
- true if this instance is paused; otherwise, false.
-
-
-
-
- Gets or sets the clip rectangle.
-
-
- The canvas.
- The clip rectangle.
-
-
-
-
- Gets or sets the clip rectangle.
-
- The canvas.
-
- The clip rectangle.
-
-
-
-
- Initializes the task.
-
- The context.
-
-
-
- Gets the geometries.
-
-
- The canvas.
-
-
-
- Sets the geometries.
-
- The canvas.
- The geometries.
-
-
-
- Adds the geometry to paint task.
-
- The canvas.
- The geometry.
-
-
-
- Removes the geometry from pain task.
-
- The canvas.
- The geometry.
-
-
-
- Removes all geometry from paint task.
-
- The canvas.
-
-
-
- Sets the opacity according to the given geometry.
-
- The context.
- The geometry.
-
-
-
- Resets the opacity.
-
- The context.
- The geometry.
-
-
-
- Clones the task.
-
-
-
-
-
- Defines a geometry in the user interface.
-
- The type of the drawing context.
-
-
-
-
- Gets or sets the opacity.
-
-
- The opacity.
-
-
-
-
- Gets or sets the rotation.
-
-
- The rotation.
-
-
-
-
- Gets or sets the x.
-
-
- The x.
-
-
-
-
- Gets or sets the y.
-
-
- The y.
-
-
-
-
- Measures the specified drawable task.
-
- The drawable task.
-
-
-
-
- Defines a label geometry in the user interface.
-
- The type of the drawing context.
-
-
-
-
- Gets or sets the padding.
-
-
- The padding.
-
-
-
-
- Gets or sets the vertical align.
-
-
- The vertical align.
-
-
-
-
- Gets or sets the horizontal align.
-
-
- The horizontal align.
-
-
-
-
- Gets or sets the text.
-
-
- The text.
-
-
-
-
- Gets or sets the size of the text.
-
-
- The size of the text.
-
-
-
-
- Defines a line bezier segment chart point.
-
- The type of the drawing context.
-
-
-
-
- Gets the geometry.
-
-
- The geometry.
-
-
-
-
- Gets the bezier.
-
-
- The bezier.
-
-
-
-
- Defines a line geometry in the user interface.
-
- The type of the drawing context.
-
-
-
-
- Gets or sets the x1.
-
-
- The x1.
-
-
-
-
- Gets or sets the y1.
-
-
- The y1.
-
-
-
-
- Defines a line path segment.
-
- The type of the path.
-
-
-
-
- Gets or sets the x.
-
-
- The x.
-
-
-
-
- Gets or sets the y.
-
-
- The y.
-
-
-
-
- Defines the move to path comamnd.
-
- The type of the path.
-
-
-
-
- Gets or sets the x.
-
-
- The x.
-
-
-
-
- Gets or sets the y.
-
-
- The y.
-
-
-
-
- Defines a path command.
-
- The type of the path context.
-
-
-
-
- Executes the command in the path.
-
- The path.
- The current time.
- The path geometry.
-
-
-
- Defines a path geometry in the user interface.
-
- The type of the drawing context.
- The type of the path arguments.
-
-
-
-
- Gets or sets a value indicating whether the path is closed.
-
-
- true if this instance is closed; otherwise, false.
-
-
-
-
- Adds a path command.
-
- The command.
-
-
-
- Determines whether the specified command is contained in the current path.
-
- The command.
-
- true if the specified command contains command; otherwise, false.
-
-
-
-
- Removes a given command.
-
- The command.
-
-
-
- Clears the commands.
-
-
-
-
- Defines a rounded rectangle visual chart point.
-
- The type of the drawing context.
-
-
-
-
- Gets or sets the rx, the radius used in the x axis to round the corners of each column in pixels.
-
-
- The rx.
-
-
-
-
- Gets or sets the ry, the radius used in the y axis to round the corners of each column in pixels.
-
-
- The ry.
-
-
-
-
- Defines a sized geometry in the user interface.
-
- The type of the drawing context.
-
-
-
-
- Gets or sets the width.
-
-
- The width.
-
-
-
-
- Gets or sets the height.
-
-
- The height.
-
-
-
-
- Defines a sized visual chart point.
-
- The type of the drawing context.
-
-
-
-
-
- Defines an object that contains a to highlight when the point requires so.
-
-
-
-
- Gets the main .
-
-
-
-
- Defines a line bezier visual point.
-
- The type of the drawing context.
- The type of the visual.
- The type of the bezier segment.
- The type of the path arguments.
-
-
-
-
- Gets the geometry.
-
-
- The geometry.
-
-
-
-
- Gets the bezier.
-
-
- The bezier.
-
-
-
-
- Gets the main .
-
-
-
-
- Defines a canvas that is able to animate the shapes inside it.
-
- The type of the drawing context.
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Occurs when the visual is invalidated.
-
-
-
-
- Occurs when all the visuals in the canvas are valid.
-
-
-
-
- Returns true if the visual is valid.
-
-
- true if this instance is valid; otherwise, false.
-
-
-
-
- Gets the synchronize object.
-
-
- The synchronize.
-
-
-
-
- Draws the frame.
-
- The context.
-
-
-
-
- Gets the drawables count.
-
-
- The drawables count.
-
-
-
-
- Invalidates this instance.
-
-
-
-
-
- Adds a drawable task.
-
- The task.
-
-
-
-
- Sets the paint tasks.
-
- The tasks.
-
-
-
-
- Removes the paint task.
-
- The task.
-
-
-
-
- Counts the geometries.
-
-
-
-
-
- A set of predefined easing functions.
-
-
-
-
- Gets the back in.
-
-
- The back in.
-
-
-
-
- Gets the back out.
-
-
- The back out.
-
-
-
-
- Gets the back in out.
-
-
- The back in out.
-
-
-
-
- Gets the bounce in.
-
-
- The bounce in.
-
-
-
-
- Gets the bounce out.
-
-
- The bounce out.
-
-
-
-
- Gets the bounce in out.
-
-
- The bounce in out.
-
-
-
-
- Gets the circle in.
-
-
- The circle in.
-
-
-
-
- Gets the circle out.
-
-
- The circle out.
-
-
-
-
- Gets the circle in out.
-
-
- The circle in out.
-
-
-
-
- Gets the cubic in.
-
-
- The cubic in.
-
-
-
-
- Gets the cubic out.
-
-
- The cubic out.
-
-
-
-
- Gets the cubic in out.
-
-
- The cubic in out.
-
-
-
-
- Gets the ease.
-
-
- The ease.
-
-
-
-
- Gets the ease in.
-
-
- The ease in.
-
-
-
-
- Gets the ease out.
-
-
- The ease out.
-
-
-
-
- Gets the ease in out.
-
-
- The ease in out.
-
-
-
-
- Gets the elastic in.
-
-
- The elastic in.
-
-
-
-
- Gets the elastic out.
-
-
- The elastic out.
-
-
-
-
- Gets the elastic in out.
-
-
- The elastic in out.
-
-
-
-
- Gets the exponential in.
-
-
- The exponential in.
-
-
-
-
- Gets the exponential out.
-
-
- The exponential out.
-
-
-
-
- Gets the exponential in out.
-
-
- The exponential in out.
-
-
-
-
- Gets the lineal.
-
-
- The lineal.
-
-
-
-
- Gets the polinominal in.
-
-
- The polinominal in.
-
-
-
-
- Gets the polinominal out.
-
-
- The polinominal out.
-
-
-
-
- Gets the polinominal in out.
-
-
- The polinominal in out.
-
-
-
-
- Gets the quadratic in.
-
-
- The quadratic in.
-
-
-
-
- Gets the quadratic out.
-
-
- The quadratic out.
-
-
-
-
- Gets the quadratic in out.
-
-
- The quadratic in out.
-
-
-
-
- Gets the sin in.
-
-
- The sin in.
-
-
-
-
- Gets the sin out.
-
-
- The sin out.
-
-
-
-
- Gets the sin in out.
-
-
- The sin in out.
-
-
-
-
- Gets the build custom back in.
-
-
- The build custom back in.
-
-
-
-
- Gets the build custom back out.
-
-
- The build custom back out.
-
-
-
-
- Gets the build custom back in out.
-
-
- The build custom back in out.
-
-
-
-
- Gets the build custom elastic in.
-
-
- The build custom elastic in.
-
-
-
-
- Gets the build custom elastic out.
-
-
- The build custom elastic out.
-
-
-
-
- Gets the build custom elastic in out.
-
-
- The build custom elastic in out.
-
-
-
-
- Gets the build custom polinominal in.
-
-
- The build custom polinominal in.
-
-
-
-
- Gets the build custom polinominal out.
-
-
- The build custom polinominal out.
-
-
-
-
- Gets the build custom polinominal in out.
-
-
- The build custom polinominal in out.
-
-
-
-
- Gets the build cubic bezier.
-
-
- The build cubic bezier.
-
-
-
-
- Defines the BackEasingFunction
-
-
-
-
- The in easing
-
- The t.
- The s.
-
-
-
-
- the out easing
-
- The t.
- The s.
-
-
-
-
- the in out easing
-
- The t.
- The s.
-
-
-
-
- Defines the BounceEasingFunction
-
-
-
-
- the in easing.
-
- The t.
-
-
-
-
- the out easing.
-
- The t.
-
-
-
-
- the in out easing.
-
- The t.
-
-
-
-
- Defines the CircleEasingFunction
-
-
-
-
- the ease in.
-
- The t.
-
-
-
-
- the ease out.
-
- The t.
-
-
-
-
- the ease in out
-
- The t.
-
-
-
-
- Defines the CubicBezierEasingFunction.
-
-
-
-
- Builds a bezier easing function.
-
- The m x1.
- The m y1.
- The m x2.
- The m y2.
-
- Bezier x values must be in [0, 1] range
-
-
-
- Defines the CubicEasingFunction
-
-
-
-
- The ease in.
-
- The t.
-
-
-
-
- The ease out.
-
- The t.
-
-
-
-
- The ease in out.
-
- The t.
-
-
-
-
- A helper class to build delayed animations.
-
-
-
-
- Initializes a new instance of the class.
-
- The base function.
- The point.
- The per point delay.
-
-
-
- Gets the function.
-
-
- The function.
-
-
-
-
- Gets the speed.
-
-
- The speed.
-
-
-
-
- Defines the ElasticEasingFunction.
-
-
-
-
- The ease in.
-
- The t.
- a.
- The p.
-
-
-
-
- The ease out.
-
- The t.
- a.
- The p.
-
-
-
-
- The ease in out.
-
- The t.
- a.
- The p.
-
-
-
-
- Defines the ExponentialEasingFunction.
-
-
-
-
- The ease in.
-
- The t.
-
-
-
-
- The ease out.
-
- The t.
-
-
-
-
- The ease in out.
-
- The t.
-
-
-
-
- Defines the PolinominalEasingFunction.
-
-
-
-
- The ease in.
-
- The t.
- The e.
-
-
-
-
- The ease out.
-
- The t.
- The e.
-
-
-
-
- The ease in out.
-
- The t.
- The e.
-
-
-
-
- Defines a chart series.
-
-
-
-
- Gets or sets a series unique identifier, the library handles this id automatically.
-
-
-
-
- Gets or sets the state where the visual is moved to when the mouse moves over a .
-
-
-
-
- Gets the properties of the series.
-
-
-
-
- Gets or sets the name of the series, the name is normally used by or
- , the default value is set automatically by the library.
-
-
-
-
- Gets or sets the values.
-
-
- The values.
-
-
-
-
- Gets or sets a value indicating whether this instance is visible.
-
-
- true if this instance is visible; otherwise, false.
-
-
-
-
- Gets or sets the data padding, both coordinates (X and Y) from 0 to 1, where 0 is nothing and 1 is the axis tick
- (the separation between every label).
-
-
- The data padding.
-
-
-
-
- Gets or sets the z index position.
-
-
- The index of the z.
-
-
-
-
- Gets or sets the value where the direction of the axis changes, by default is 0.
-
-
-
-
- Gets or sets the animations speed, if this property is null, the
- property will be used.
-
-
- The animations speed.
-
-
-
-
- Gets or sets the easing function to animate the series, if this property is null, the
- property will be used.
-
-
- The easing function.
-
-
-
-
- Gets or sets the tool tip label formatter, this function will build the label when a point in this series
- is shown inside a tool tip.
-
-
- The tool tip label formatter.
-
-
-
-
- Gets or sets the data label formatter, this function will build the label when a point in this series
- is shown as data label.
-
-
- The data label formatter.
-
-
-
-
- Occurs before the series is disposed.
-
-
-
-
- Gets a array with the points used to generate the plot.
-
- the chart
-
-
-
-
- Gets the instances which contain the , according
- to the chart's property.
-
- the chart
- the pointer position
-
-
-
-
- Marks a given point as a given state.
-
-
-
-
-
-
- Removes a given point from the given state.
-
-
-
-
-
-
- Clears the visuals in the cache and re-starts animations.
-
-
-
-
- Deletes the series from the user interface.
-
-
-
-
- Defines a series.
-
- The type of the model.
-
-
-
-
- Gets or sets the mapping.
-
-
- The mapping.
-
-
-
-
- Gets or sets the values.
-
-
- The values.
-
-
-
-
- An object that is able to throttle an action.
-
-
-
-
- Initializes a new instance of the class.
-
- The target action to throttle.
- The throttling time.
-
-
-
- Schedules a call to the target action.
-
-
-
-
-
- Forces the call to the target action, this call is not throttled.
-
-
-
-
-
- Defines the area helper class.
-
- The type of the drawing context.
- The type of the geometry path.
- The type of the line segment.
- The type of the move to.
- The type of the path context.
-
-
-
- Gets or sets the path.
-
-
- The path.
-
-
-
-
- Gets or sets the start point.
-
-
- The start point.
-
-
-
-
- Gets or sets the start segment.
-
-
- The start segment.
-
-
-
-
- Gets or sets the end segment.
-
-
- The end segment.
-
-
-
-
- Gets or sets a value indicating whether this instance is initialized.
-
-
- true if this instance is initialized; otherwise, false.
-
-
-
-
- Initializes the helper with the specified transition setter.
-
- The transition setter.
- The default animation.
-
-
-
-
- Defines the bezier data class.
-
-
-
-
- Initializes a new instance of the class.
-
- The chart point.
-
-
-
- Gets or sets the target point.
-
-
- The target point.
-
-
-
-
- Gets or sets the x0.
-
-
- The x0.
-
-
-
-
- Gets or sets the y0.
-
-
- The y0.
-
-
-
-
- Gets or sets the x1.
-
-
- The x1.
-
-
-
-
- Gets or sets the y1.
-
-
- The y1.
-
-
-
-
- Gets or sets the x2.
-
-
- The x2.
-
-
-
-
- Gets or sets the y2.
-
-
- The y2.
-
-
-
-
- Gets or sets the original data.
-
-
- The original data.
-
-
-
-
- Gets or sets a value indicating whether this instance is first.
-
-
- true if this instance is first; otherwise, false.
-
-
-
-
- Gets or sets a value indicating whether this instance is last.
-
-
- true if this instance is last; otherwise, false.
-
-
-
-
- Defines a method that will handle an event in a chart.
-
- The type of the drawing context.
- The chart.
-
-
-
- Defines a point in a chart.
-
-
-
-
- Initializes a new instance of the class.
-
- The chart.
- The series.
-
-
-
- Gets or sets a value indicating whether this instance is null.
-
-
- true if this instance is null; otherwise, false.
-
-
-
-
- Gets or sets the primary value.
-
-
- The primary value.
-
-
-
-
- Gets or sets the secondary value.
-
-
- The secondary value.
-
-
-
-
- Gets or sets the tertiary value.
-
-
- The tertiary value.
-
-
-
-
- Gets the point as tooltip string.
-
-
- As tooltip string.
-
-
-
-
- Gets the point as data label.
-
-
- As tooltip string.
-
-
-
-
- Gets the context.
-
-
- The context.
-
-
-
-
- Defines the environment of a point in a chart.
-
-
-
-
- Initializes a new instance of the class.
-
- The chart.
- The series.
-
-
-
- Gets the chart.
-
-
- The chart.
-
-
-
-
- Gets the series.
-
-
- The series.
-
-
-
-
- Gets the position of the point the collection that was used when the point was drawn.
-
-
-
-
- Gets the DataSource.
-
-
-
-
- Gets the visual.
-
-
- The visual.
-
-
-
-
- Gets the label.
-
-
- The label.
-
-
-
-
- Gets or sets the area that triggers the ToolTip.
-
-
-
-
- Defines the chart update parameter.
-
-
-
-
- Gets or sets a value indicating whether this instance is automatic update.
-
-
- true if this instance is automatic update; otherwise, false.
-
-
-
-
- Gets or sets a value indicating whether this is throttling.
-
-
- true if throttling; otherwise, false.
-
-
-
-
- A helper class that tracks both, and
- events.
-
-
-
-
-
- The check i notify property changed
-
-
-
-
- Initializes a new instance of the class.
-
- The on collection changed handler.
- The on item property changed handler.
- if true, it will force the check to verify if the type {T} implements INotifyPropertyChanged.
-
-
-
- Initializes the listeners.
-
- The instance.
-
-
-
-
- Disposes the listeners.
-
- The instance.
-
-
-
-
- Defines the data factory class.
-
- The type of the drawing context.
-
-
-
-
- Gets the provider.
-
- The type of the model.
-
-
-
-
- Defines a data provider.
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Fetches the the points for the specified series.
-
- The series.
- The chart.
-
-
-
-
- Disposes a given point.
-
- The point.
-
-
-
-
- Gets the Cartesian bounds.
-
- The chart.
- The series.
- The x.
- The y.
-
-
-
-
- Gets the pie bounds.
-
- The chart.
- The series.
-
- Unexpected null stacker
-
-
-
- Clears the visuals in the cache.
-
-
-
-
-
- Defines a default paint task.
-
- The type of the drawing context.
-
-
-
-
- Gets or sets a value indicating whether this instance is stroke.
-
-
- true if this instance is stroke; otherwise, false.
-
-
-
-
- Gets or sets a value indicating whether this instance is fill.
-
-
- true if this instance is fill; otherwise, false.
-
-
-
-
- Gets or sets the index of the z.
-
-
- The index of the z.
-
-
-
-
- Gets or sets the stroke thickness.
-
-
- The stroke thickness.
-
-
-
-
- Gets or sets a value indicating whether this instance is completed.
-
-
- true if this instance is completed; otherwise, false.
-
-
-
-
- Gets or sets the current time.
-
-
- The current time.
-
-
-
-
- Gets or sets a value indicating whether the element is removed when all the transitions complete.
-
-
- true if remove on completed; otherwise, false.
-
-
-
-
- Gets or sets a value indicating whether this instance is paused.
-
-
- true if this instance is paused; otherwise, false.
-
-
-
-
- Adds the geometry to paint task.
-
- The canvas.
- The geometry.
-
-
-
- Clones the task.
-
-
-
-
-
- Completes the transitions.
-
- Name of the property.
-
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
-
-
-
- Gets the geometries.
-
- The canvas.
- The .
-
-
-
-
- Gets the transition property.
-
- Name of the property.
-
-
-
-
- Initializes the task.
-
- The context.
-
-
-
- Removes the geometry from pain task.
-
- The canvas.
- The geometry.
-
-
-
- Removes all geometry from paint task.
-
- The canvas.
-
-
-
- Removes a property transition.
-
- Name of the property.
-
-
-
- Sets the geometries.
-
- The canvas.
- The geometries.
-
-
-
- Sets the properties transitions.
-
- The animation.
- Name of the property.
-
-
-
-
- Completes all transitions.
-
-
-
-
-
- Removes all the current transitions.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- LiveCharts kerner extensions.
-
-
-
-
- Returns the left, top coordinate of the tooltip based on the found points, the position and the tooltip size.
-
-
-
-
-
-
-
-
- Returns the left, top coordinate of the tooltip based on the found points, the position and the tooltip size.
-
- The found points.
- The position.
- Size of the tooltip.
-
-
-
-
- Gets the tick.
-
- The type of the drawing context.
- The axis.
- Size of the control.
-
-
-
-
- Gets the tick.
-
- The type of the drawing context.
- The axis.
- Size of the control.
- The bounds.
-
-
-
-
- Creates a transition builder for the specified properties.
-
- The animatable.
- The properties.
-
- At least one property is required when calling {nameof(TransitionateProperties)}
-
-
-
- Determines whether is bar series.
-
- The series.
-
- true if [is bar series] [the specified series]; otherwise, false.
-
-
-
-
- Determines whether is column series.
-
- The series.
-
- true if [is column series] [the specified series]; otherwise, false.
-
-
-
-
- Determines whether is row series.
-
- The series.
-
- true if [is row series] [the specified series]; otherwise, false.
-
-
-
-
- Determines whether is stacked series.
-
- The series.
-
- true if [is stacked series] [the specified series]; otherwise, false.
-
-
-
-
- Determines whether is vertical series.
-
- The series.
-
- true if [is vertical series] [the specified series]; otherwise, false.
-
-
-
-
- Determines whether is horizontal series.
-
- The series.
-
- true if [is horizontal series] [the specified series]; otherwise, false.
-
-
-
-
- Adds a point to the specified state.
-
- The chart point.
- The state.
-
-
-
- Removes a point from the specified state.
-
- The chart point.
- The state.
-
-
-
- Adds a point to the hover state.
-
- The chart point.
-
-
-
- Removes a point from the hover state.
-
- The chart point.
-
-
-
- Defines a hover area.
-
-
-
-
- Determines whether the area is trigger by the specified point in the user interface.
-
- The point.
- The strategy.
-
- true if [is trigger by] [the specified point]; otherwise, false.
-
-
-
-
- Suggests the tooltip placement.
-
- The context.
-
-
-
- Defines an Axis in a Cartesian chart.
-
-
-
-
- Gets the previous data bounds.
-
-
- The previous data bounds.
-
-
-
-
- Gets the previous data bounds.
-
-
- The previous data bounds.
-
-
-
-
- Gets the data bounds, the min and max values in the axis.
-
-
- The data bounds.
-
-
-
-
- Gets the data visible bounds, the min and max visible values in the axis.
-
-
- The data bounds.
-
-
-
-
- Gets the orientation.
-
-
- The orientation.
-
-
-
-
- Gets or sets the padding.
-
-
- The padding.
-
-
-
-
- Gets or sets the xo, a reference used internally to calculate the axis position.
-
-
- The xo.
-
-
-
-
- Gets or sets the yo, a reference used internally to calculate the axis position..
-
-
- The yo.
-
-
-
-
- Gets or sets the labeler, a function that receives a number and return the label content as string.
-
-
- The labeler.
-
-
-
-
- Gets or sets the minimum step, the step defines the interval between every separator in the axis,
- LiveCharts will calculate it automatically based on the chart data and the chart size size, if the calculated step is less than the
- then will be used as the axis step, default is 0.
-
-
- The step.
-
-
-
-
- Gets or sets the unit with, it means the width of every point (if the series requires it) in the chart values scale, this value
- should normally be 1, unless you are plotting in a custom scale, default is 1.
-
-
- The unit with.
-
-
-
-
- Gets or sets the minimum value visible in the axis, any point less than this value will be hidden,
- set it to null to use a value based on the smaller value in the chart.
-
-
- The minimum value.
-
-
-
-
- Gets or sets the maximum value visible in the axis, any point greater than this value will be hidden,
- set it null to use a value based on the greater value in the chart.
-
-
- The maximum value.
-
-
-
-
- Gets or sets the previous maximum limit.
-
-
- The previous maximum limit.
-
-
-
-
- Gets or sets the previous minimum limit.
-
-
- The previous minimum limit.
-
-
-
-
- Gets or sets a value indicating whether this instance is visible.
-
-
- true if this instance is visible; otherwise, false.
-
-
-
-
- Gets or sets a value indicating whether the axis is inverted based on the Cartesian coordinate system.
-
-
- true if this instance is inverted; otherwise, false.
-
-
-
-
- Gets or sets the axis position.
-
-
- The position.
-
-
-
-
- Gets or sets the labels rotation.
-
-
- The labels rotation.
-
-
-
-
- Gets or sets the size of the text.
-
-
- The size of the text.
-
-
-
-
- Gets or sets the labels, if labels are not null, then the axis label will be pulled from the labels collection,
- the label is mapped to the chart based on the position of the label and the position of the point, both integers,
- if the axis requires a label outside the bounds of the labels IList then the index will be returned as the label.
- Default value is null.
-
-
- The labels.
-
-
-
-
- Gets or sets the animations speed, if this property is null, the
- property will be used.
-
-
- The animations speed.
-
-
-
-
- Gets or sets the easing function to animate the series, if this property is null, the
- property will be used.
-
-
- The easing function.
-
-
-
-
- Gets or sets a value indicating whether the separator lines are visible.
-
-
-
-
- Initializes the axis for the specified orientation.
-
- The orientation.
-
-
-
- Defines an Axis in a Cartesian chart.
-
- The type of the drawing context.
-
-
-
-
- Gets or sets the text brush.
-
-
- The text brush.
-
-
-
-
- Gets or sets the separators brush.
-
-
- The separators brush.
-
-
-
-
- Measures the axis.
-
- The chart.
-
-
-
- Gets the size of the possible.
-
- The chart.
-
-
-
-
- Gets the deleting tasks.
-
-
- The deleting tasks.
-
-
-
-
- Defines a bar series point.
-
- The type of the drawing context.
-
-
-
-
- Gets or sets the rx, the radius used in the x axis to round the corners of each column in pixels.
-
-
- The rx.
-
-
-
-
- Gets or sets the ry, the radius used in the y axis to round the corners of each column in pixels.
-
-
- The ry.
-
-
-
-
- Gets or sets the padding for each group of bars that share the same secondary coordinate.
-
-
- The bar group padding.
-
-
-
-
- Gets or sets the maximum width of the bar.
-
-
- The maximum width of the bar.
-
-
-
-
- Gets or sets a value indicating whether the bar position respects the other bars that share
- the same .
-
-
-
-
- Defines a Cartesian chart view, this view is able to host one or many series in a Cartesian coordinate system.
-
- The type of the drawing context.
-
-
-
-
- Gets the core.
-
-
- The core.
-
-
-
-
- Gets or sets the x axes.
-
-
- The x axes.
-
-
-
-
- Gets or sets the y axes.
-
-
- The y axes.
-
-
-
-
- Gets or sets the series to plot in the user interface.
-
-
- The series.
-
-
-
-
- Gets or sets the zoom mode.
-
-
- The zoom mode.
-
-
-
-
- Gets or sets the zooming speed from 0 to 1, where 0 is the fastest and 1 the slowest.
-
-
- The zooming speed.
-
-
-
-
- Scales the UI point.
-
- The point.
- Index of the x axis.
- Index of the y axis.
-
-
-
-
- Defines a Cartesian series.
-
- The type of the drawing context.
-
-
-
-
- Gets or sets the axis index where the series is scaled in the X plane, the index must exist
- in the collection.
-
-
- The index of the axis.
-
-
-
-
- Gets or sets the axis index where the series is scaled in the Y plane, the index must exist
- in the collection.
-
-
- The index of the axis.
-
-
-
-
- Gets or sets the data labels position.
-
-
- The data labels position.
-
-
-
-
- Gets the series bounds.
-
- The chart.
- The x.
- The y.
- the series bounds
-
-
-
- Measures the series and schedules the draw in specified chart.
-
- The chart.
- The x axis.
- The y axis.
-
-
-
- Defines a chart.
-
-
-
-
- Gets or sets the measure work.
-
-
- The measure work.
-
-
-
-
- Gets the chart view.
-
-
- The view.
-
-
-
-
- Gets the canvas.
-
-
- The canvas.
-
-
-
-
- Gets the legend position.
-
-
- The legend position.
-
-
-
-
- Gets the legend orientation.
-
-
- The legend orientation.
-
-
-
-
- Gets the toolTip position.
-
-
- The toolTip position.
-
-
-
-
- Gets the toolTip finding strategy.
-
-
- The toolTip finding strategy.
-
-
-
-
- Updates the chart in the user interface.
-
-
-
-
- Defines a chart legend.
-
- The type of the drawing context.
-
-
-
- Draws the legend for the specified chart.
-
- The chart.
-
-
-
- Defines a tool tip.
-
- The type of the drawing context.
-
-
-
- Shows the tool tip in the specified chart.
-
- The found points.
- The chart.
-
-
-
- Hides this tool tip instance.
-
-
-
-
- Defines a chart view
-
-
-
-
- Gets the core.
-
-
- The core.
-
-
-
-
- Sets the back color of the control.
-
-
- The color of the back.
-
-
-
-
- Gets the size of the control.
-
-
- The size of the control.
-
-
-
-
- Gets or sets the draw margin, if this property is null, the library will calculate a margin, this margin is the distance
- between the view bounds and the drawable area.
-
-
- The draw margin.
-
-
-
-
- Gets or sets the animations speed.
-
-
- The animations speed.
-
-
-
-
- Gets or sets the easing function, the library already provides many easing functions in the
- LiveCharts.EasingFunction static class.
-
-
- The easing function.
-
-
-
-
- Gets or sets the legend position.
-
-
- The legend position.
-
-
-
-
- Gets or sets the legend orientation.
-
-
- The legend orientation.
-
-
-
-
- Gets or sets the tooltip position.
-
-
- The tooltip position.
-
-
-
-
- Gets or sets the tooltip finding strategy.
-
-
- The tooltip finding strategy.
-
-
-
-
- Defines a chart view.
-
- The type of the drawing context.
-
-
-
- Occurs before the chart is measured, this is the first step before the chart updates.
-
-
-
-
- Occurs when the chart started an update, just when the drawing loop started.
-
-
-
-
- Occurs when a chart update finished, just when the drawing loop finished.
-
-
-
-
- Gets or sets a value indicating whether the automatic updates are enabled.
-
-
- true if automatic update are enabled; otherwise, false.
-
-
-
-
- Gets the core canvas.
-
-
- The core canvas.
-
-
-
-
- Gets the legend.
-
-
- The legend.
-
-
-
-
- Gets the tooltip.
-
-
- The tooltip.
-
-
-
-
- Gets or sets the point states.
-
-
- The point states.
-
-
-
-
- Shows the tool tip based on the given points.
-
- The points.
-
-
-
- Hides the tool tip.
-
-
-
-
- Defines adata factory provider.
-
- The type of the drawing context.
-
-
-
- Gets the provider.
-
- The type of the model.
-
-
-
-
- Defines a series a chart series that has a visual representation in the user interface.
-
- The type of the drawing context.
-
-
-
-
- Gets or sets the stroke drawable task.
-
-
- The stroke.
-
-
-
-
- Gets or sets the fill drawable task.
-
-
- The fill.
-
-
-
-
- Gets or sets the data labels drawable task.
-
-
-
-
- Gets or sets the size of the data labels.
-
-
- The size of the data labels.
-
-
-
-
- Gets or sets the data labels padding.
-
-
- The data labels padding.
-
-
-
-
- Gets the default paint context, normally handled internally to display tooltips and legends.
-
-
- The default paint context.
-
-
-
-
- Gets the stack group, normally used internally to handled the stacked series.
-
-
-
-
-
- Gets the deleting tasks.
-
-
- The deleting tasks.
-
-
-
-
- Defines a gauge builder
-
-
-
-
- Gets or sets the inner radius.
-
-
- The inner radius.
-
-
-
-
- Gets or sets the offset radius, the separation between each gauge if multiple gauges are nested.
-
-
- The relative inner radius.
-
-
-
-
- Gets or sets the maximum width of the radial column.
-
-
- The maximum width of the radial column.
-
-
-
-
- Gets or sets the corner radius.
-
-
- The corner radius.
-
-
-
-
- Gets or sets the radial align.
-
-
- The radial align.
-
-
-
-
- Gets or sets the background inner radius.
-
-
- The background inner radius.
-
-
-
-
- Gets or sets the background offset radius, the separation between each gauge if multiple gauges are nested.
-
-
- The background relative inner radius.
-
-
-
-
- Gets or sets the width of the background maximum radial column.
-
-
- The width of the background maximum radial column.
-
-
-
-
- Gets or sets the background corner radius.
-
-
- The background corner radius.
-
-
-
-
- Gets or sets the background.
-
-
- The background.
-
-
-
-
- Gets or sets the size of the labels.
-
-
- The size of the labels.
-
-
-
-
- Gets or sets the labels position.
-
-
- The labels position.
-
-
-
-
- Gets or sets the label formatter.
-
-
- The label formatter.
-
-
-
-
- Defines a line series plot.
-
- The type of the drawing context.
-
-
-
-
- Gets or sets the size of the geometry.
-
-
- The size of the geometry.
-
-
-
-
- Gets or sets the line smoothness, where 0 is a straight line, and 1 the most curved line, default is 0.65
-
-
- The line smoothness.
-
-
-
-
- Gets or sets a value indicating whether the line should split every null point,
- enabling it has a performance impact, default is true.
-
-
-
-
- Gets or sets the geometry fill.
-
-
- The shapes fill.
-
-
-
-
- Gets or sets the geometry stroke.
-
-
- The shapes stroke.
-
-
-
-
- Defines a pie chart.
-
- The type of the drawing context.
-
-
-
-
- Gets the core.
-
-
- The core.
-
-
-
-
- Gets or sets the series.
-
-
- The series.
-
-
-
-
- Gets or sets the initial rotation in degrees, this angle specifies where the first pie slice will be drawn, then the remaining
- slices will stack according to its corresponding position.
-
-
- The initial rotation.
-
-
-
-
- Gets or sets the maximum angle in degrees, default is 360.
-
-
- The maximum angle.
-
-
-
-
- Gets or sets the total, it is the maximum value a pie slice can represent, when this property is null, the property
- will be calculated automatically based on the series data. Default value is null.
-
-
- The total stacked.
-
-
-
-
- Defines a pie series.
-
- The type of the drawing context.
-
-
-
-
- Gets or sets the push out, it is the distance in pixels between the center of the control and the pie slice.
-
-
- The push out.
-
-
-
-
- Gets or sets the inner radius of the slice in pixels.
-
-
- The inner radius.
-
-
-
-
- Gets or sets the maximum outer, the value goes from 0 to 1, where 1 is the full available radius and 0 is none.
-
-
- The maximum outer radius.
-
-
-
-
- Gets or sets the hover push out in pixes, it defines the where the pointer is over the slice.
-
-
- The hover pus hout.
-
-
-
-
- Gets or sets the corner radius for every pie slice in the series.
-
-
- The corner radius.
-
-
-
-
- Gets or sets a value indicating whether the direction of the corner radius is inverted.
-
-
- true if the direction is inverted; otherwise, false.
-
-
-
-
- Gets or sets the maximum width of the radial column, if the width of the radial column slice exceeds this dimension the radial
- column width will be capped to the value of this property, default value is double.MaxValue.
-
-
- The maximum width of the radial column.
-
-
-
-
- Gets or sets the data labels position.
-
-
- The data labels position.
-
-
-
-
- Gets or sets the radial align, this property determines the alignment of the pie slice only when the width of the column
- exceeds .
-
-
- The radial align.
-
-
-
-
- Gets or sets the relative inner radius, it is the extra inner radius for every stacked slice.
-
-
- The inner padding.
-
-
-
-
- Gets or sets the relative outer radius, it is the decrement in the outer radius for every stacked slice.
-
-
- The inner padding.
-
-
-
-
- Gets or sets a value indicating whether this instance is a fill series, a fill series is a dummy series that will create a 360 degrees
- pie slice, this series is normally used to set a background for pie charts, specially useful o create gauges.
-
-
- true if this instance is fill series; otherwise, false.
-
-
-
-
- Gets the series bounds.
-
- The chart.
-
-
-
-
- Measures the series and schedules the draw in specified chart.
-
- The chart.
-
-
-
- Defines a scatter series.
-
- The type of the drawing context.
-
-
-
-
- Gets or sets the size of the geometry.
-
-
- The size of the geometry.
-
-
-
-
- Gets or sets the minimum size of the geometry.
-
-
- The minimum size of the geometry.
-
-
-
-
- Defines a stacked bar series.
-
- The type of the drawing context.
-
-
-
-
- Gets or sets the rx, the radius used in the x axis to round the corners of each column, it goes from 0 to 1.
-
-
- The rx.
-
-
-
-
- Gets or sets the ry, the radius used in the y axis to round the corners of each column, it goes from 0 to 1.
-
-
- The ry.
-
-
-
-
- Gets or sets the maximum width of the bar.
-
-
- The maximum width of the bar.
-
-
-
-
- Gets or sets the stack group.
-
-
- The stack group.
-
-
-
-
- LiveCharts global settings
-
-
-
-
- Gets or sets the default easing function.
-
-
- The default easing function.
-
-
-
-
- Gets or sets the default animations speed.
-
-
- The default animations speed.
-
-
-
-
- Gets or sets the default zoom speed.
-
-
- The default zoom speed.
-
-
-
-
- Gets or sets the default zoom mode.
-
-
- The default zoom mode.
-
-
-
-
- Gets or sets the default legend position.
-
-
- The default legend position.
-
-
-
-
- Gets or sets the default legend orientation.
-
-
- The default legend orientation.
-
-
-
-
- Gets or sets the default tooltip position.
-
-
- The default tooltip position.
-
-
-
-
- Gets or sets the default tooltip finding strategy.
-
-
- The default tooltip finding strategy.
-
-
-
-
- Gets the theme identifier.
-
-
- The theme identifier.
-
-
-
-
- Gets the axis provider.
-
-
- The axis provider.
-
-
-
-
- Adds or replaces a mapping for a given type, the mapper defines how a type is mapped to a instance,
- then the will be drawn as a point in our chart.
-
- The type of the model.
- The mapper.
-
-
-
-
- Sets the default animations speed.
-
- The animations speed.
- the current settings
-
-
-
- Withes the default easing function.
-
- The easing function.
- the current settings
-
-
-
- Withes the default zoom speed.
-
- The speed.
- the current settings
-
-
-
- Withes the default zoom mode.
-
- The zoom mode.
- the current settings
-
-
-
- Removes a map from the settings.
-
- The type of the model.
-
-
-
-
- Adds the default styles.
-
- The type of the drawing context.
- The builder.
-
-
-
-
- Gets the styles builder.
-
- The type of the drawing context.
-
- $"The type {nameof(TDrawingContext)} is not registered.
-
-
-
- Enables LiveCharts to be able to plot short, int, long, float, double, decimal, short?, int?, long?, float?, double?, decimal?,
- , , , ,
- and .
-
-
-
-
-
- The named labeler helper class.
-
-
-
-
- Initializes a new instance of the class.
-
- The labels.
-
-
-
- Functions the specified value.
-
- The value.
-
-
-
-
- Defines the paint context.
-
- The type of the drawing context.
-
-
-
- Gets or sets the width.
-
-
- The width.
-
-
-
-
- Gets or sets the height.
-
-
- The height.
-
-
-
-
- Gets or sets the paint tasks schedule.
-
-
- The paint tasks schedule.
-
-
-
-
- Defines a schedule to be drawn by an instance.
-
- The type of the drawing context.
-
-
-
- Initializes a new instance of the class.
-
- The task.
- The geometries.
-
-
-
- Initializes a new instance of the class.
-
- The task.
- The geometries.
-
-
-
- Gets or sets the drawable task.
-
-
- The drawable task.
-
-
-
-
- Gets or sets the geometries.
-
-
- The geometries.
-
-
-
-
- Defines the points states dictionary class.
-
- The type of the drawing context.
-
-
-
- Gets or sets the stroke and fill for the specified state name.
-
-
- The stroke and fill.
-
- Name of the state.
-
- $"A null instance is not valid at this point, to delete a key please use the {nameof(DeleteState)}() method.
-
-
-
- Gets the chart.
-
-
- The chart.
-
-
-
-
- Gets the states.
-
-
-
-
-
- Add the visual state for the given key.
-
- The key.
- The fill.
- The stroke.
-
-
-
-
- Deletes the state.
-
- Name of the state.
-
-
-
-
- Removes the state.
-
- The state.
-
-
-
-
- Defines a rectangle hover area.
-
-
-
-
-
- Gets or sets the x location.
-
-
- The x.
-
-
-
-
- Gets or sets the y location.
-
-
- The y.
-
-
-
-
- Gets or sets the width.
-
-
- The width.
-
-
-
-
- Gets or sets the height.
-
-
- The height.
-
-
-
-
- Sets the area dimensions.
-
- The x.
- The y.
- The width.
- The height.
-
-
-
-
-
-
-
-
-
-
- Defines a semicircle hover area.
-
-
-
-
-
- Gets or sets the center x.
-
-
- The center x coordinate.
-
-
-
-
- Gets or sets the center y.
-
-
- The center y coordinate.
-
-
-
-
- Gets or sets the start angle in degrees.
-
-
-
-
- Gets or sets the and angle in degrees.
-
-
-
-
- Gets or sets the radius.
-
-
- The radius.
-
-
-
-
- Sets the area dimensions.
-
- The center x.
- The center y.
- The start angle.
- The end angle.
- The radius.
-
-
-
-
-
-
-
-
-
-
- Defines a series context.
-
- The type of the drawing context.
-
-
-
- Initializes a new instance of the class.
-
- The series.
-
-
-
- Gets the column position.
-
- The series.
-
-
-
-
- Gets the column series count.
-
-
-
-
-
- Gets the row position.
-
- The series.
-
-
-
-
- Gets the row series count.
-
-
-
-
-
- Gets the stacked column position.
-
- The series.
-
-
-
-
- Gets the stacked column series count.
-
-
-
-
-
- Gets the stacked row position.
-
- The series.
-
-
-
-
- Gets the stacked row series count.
-
-
-
-
-
- Gets the stack position.
-
- The series.
- The stack group.
-
-
-
-
- Defines the series properties enumeration.
-
-
-
-
- includes all series
-
-
-
-
- The Cartesian series
-
-
-
-
- The bar series
-
-
-
-
- The line series
-
-
-
-
- The scatter series
-
-
-
-
- The pie series
-
-
-
-
- The stacked series
-
-
-
-
- The vertical orientation
-
-
-
-
- The horizontal orientation
-
-
-
-
- The gauge.
-
-
-
-
- The gauge fill.
-
-
-
-
- The sketch
-
-
-
-
- The solid
-
-
-
-
- Defines a series style rule.
-
- The type of the visual.
- The type of the drawing context.
-
-
-
- Gets or sets the series properties.
-
-
- The series properties.
-
-
-
-
- Gets or sets the rule.
-
-
- The rule.
-
-
-
-
- Defines the a stacked value.
-
-
-
-
- Gets or sets the start.
-
-
- The start.
-
-
-
-
- Gets or sets the end.
-
-
- The end.
-
-
-
-
- Gets or sets the total stacked.
-
-
- The total.
-
-
-
-
- Defines the stacker helper class.
-
- The type of the drawing context.
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Gets the maximum length.
-
-
- The maximum length.
-
-
-
-
- Gets the series stack position.
-
- The series.
-
-
-
-
- Stacks the point.
-
- The point.
- The series stack position.
-
-
-
-
- Gets the stack.
-
- The point.
- The series stack position.
-
-
-
-
- Defines the stroke and ill drawable class.
-
- The type of the drawing context.
-
-
-
- Initializes a new instance of the class.
-
- The stroke.
- The fill.
-
-
-
- Gets the stroke.
-
-
- The stroke.
-
-
-
-
- Gets the fill.
-
-
- The fill.
-
-
-
-
- Defines the tooltip placement context class.
-
-
-
-
- Gets or sets the most top.
-
-
- The most top.
-
-
-
-
- Gets or sets the most bottom.
-
-
- The most bottom.
-
-
-
-
- Gets or sets the most right.
-
-
- The most right.
-
-
-
-
- Gets or sets the most left.
-
-
- The most left.
-
-
-
-
- Gets or sets the pie x.
-
-
- The pie x.
-
-
-
-
- Gets or sets the pie y.
-
-
- The pie y.
-
-
-
-
- Defines the tooltip point class.
-
-
-
-
- Initializes a new instance of the class.
-
- The series.
- The point.
-
-
-
- Gets or sets the series.
-
-
- The series.
-
-
-
-
- Gets or sets the point.
-
-
- The point.
-
-
-
-
- Defines a point in a chart with known visual and label types.
-
- The type of the visual.
- The type of the label.
- The type of the drawing context.
-
-
-
- Initializes a new instance of the class.
-
- The point.
-
-
-
- Gets the chart point.
-
-
- The chart point.
-
-
-
-
- Gets the visual.
-
-
- The visual.
-
-
-
-
- Gets the label.
-
-
- The label.
-
-
-
-
- Defines bounds for both, X and Y axes.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Gets or sets the primary bounds.
-
-
-
-
- Gets or sets the secondary bounds.
-
-
-
-
- Gets or sets the tertiary bounds.
-
-
-
-
- Gets or sets the primary bounds.
-
-
-
-
- Gets or sets the secondary bounds.
-
-
-
-
- Gets or sets the tertiary bounds.
-
-
-
-
- Gets or sets the minimum delta primary.
-
-
- The minimum delta primary.
-
-
-
-
- Gets or sets the minimum delta secondary.
-
-
- The minimum delta secondary.
-
-
-
-
- Defines common functions to build labels in a chart.
-
-
-
-
- Gets the default labeler.
-
-
- The default.
-
-
-
-
- Gets the seven representative digits labeler.
-
-
- The seven representative digits.
-
-
-
-
- Gets the currency labeler.
-
-
- The currency.
-
-
-
-
- Sets the default labeler.
-
- The labeler.
-
-
-
- Formats to currency.
-
- The value.
- The thousands.
- The decimals.
- The symbol.
-
-
-
-
- Builds a named labeler.
-
- The labels.
-
-
-
-
- Defines the data to plot as a line.
-
-
-
-
- Initializes a new instance of the class.
-
- if set to true [is stacked].
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sets the default path transitions.
-
- The area helper.
- The default animation.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Releases unmanaged and - optionally - managed resources.
-
-
-
-
-
- LiveCharts global settings.
-
-
-
-
- Gets a value indicating whether this instance is configured.
-
-
- true if this instance is configured; otherwise, false.
-
-
-
-
- Gets the current settings.
-
-
- The current settings.
-
-
-
-
- Gets the bar series hover key.
-
-
- The bar series hover key.
-
-
-
-
- Gets the line series hover key.
-
-
- The line series hover key.
-
-
-
-
- Gets the pie series hover key.
-
-
- The pie series hover key.
-
-
-
-
- Gets the scatter series hover key.
-
-
- The scatter series hover key.
-
-
-
-
- Gets the stacked bar series hover key.
-
-
- The stacked bar series hover key.
-
-
-
-
- The disable animations
-
-
-
-
- Configures LiveCharts.
-
- The configuration.
-
- $"{nameof(LiveChartsSettings)} must not be null.
-
-
-
- Defines a mapper for the given type.
-
- The type of the model.
- The mapper.
-
-
-
-
- Defines the axis orientation.
-
-
-
-
- The unknown orientation.
-
-
-
-
- The x orientation.
-
-
-
-
- The y orientation.
-
-
-
-
- Defines an axis position.
-
-
-
-
- Places the axis at the bottom for X axes and at the left for Y axes
-
-
-
-
- Places the axis at the top for X axes and at the right for Y axes
-
-
-
-
- Defines an axis tick, the distance between every separator.
-
-
-
-
- Gets or sets the value.
-
-
- The value.
-
-
-
-
- Gets or sets the magnitude.
-
-
- The magnitude.
-
-
-
-
- Represents the maximum and minimum values in a set.
-
-
-
-
- Creates a new instance of the class.
-
-
-
-
- Gets or sets the maximum value in the data set.
-
-
-
-
- Gets or sets the minimum value in the data set.
-
-
-
-
- Gets the delta, the absolute range in the axis.
-
-
- The delta.
-
-
-
-
- Gets or sets the minimum delta.
-
-
- The minimum delta.
-
-
-
-
- Compares the current bounds with a given value,
- if the given value is greater than the current instance property then the given value is set at property,
- if the given value is less than the current instance property then the given value is set at property.
-
- the value to append
- Whether the value affected the current bounds, true if it affected, false if did not.
-
-
-
- Defines the data labels position.
-
-
-
-
- Aligns the label to the end in the axis direction.
-
-
-
-
- Aligns the label to the start in the axis direction.
-
-
-
-
- Aligns the label to the middle of the axis.
-
-
-
-
- Aligns the label to the top.
-
-
-
-
- Aligns the label to the top.
-
-
-
-
- Aligns the label to the left.
-
-
-
-
- Aligns the label to the right.
-
-
-
-
- Defines the legend orientation.
-
-
-
-
- The automatic orientation.
-
-
-
-
- The horizontal orientation.
-
-
-
-
- The vertical orientation.
-
-
-
-
- Defines the legend position enumeration.
-
-
-
-
- The hidden position, hides the legend form the user interface.
-
-
-
-
- The top position, places the legend at the top of the chart.
-
-
-
-
- The left position, places the legend at the left of the chart.
-
-
-
-
- The right position, places the legend at the right of the chart.
-
-
-
-
- The bottom position, places the legend at the bottom of the chart.
-
-
-
-
- Defines the margin class.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- The left.
- The top.
- The right.
- The bottom.
-
-
-
- Gets or sets the left.
-
-
- The left.
-
-
-
-
- Gets or sets the top.
-
-
- The top.
-
-
-
-
- Gets or sets the right.
-
-
- The right.
-
-
-
-
- Gets or sets the bottom.
-
-
- The bottom.
-
-
-
-
-
-
-
-
-
- Places the label at the center of the chart.
-
-
-
-
- Aligns the label to the end in the axis direction.
-
-
-
-
- Aligns the label to the start in the axis direction.
-
-
-
-
- Aligns the label to the middle of the axis.
-
-
-
-
- Defines the radial alignment.
-
-
-
-
- Aligns the element to the outer radius.
-
-
-
-
- Aligns the element to the center of the outer and inner radius.
-
-
-
-
- Aligns the element to the inner radius.
-
-
-
-
- Defines the scaler class, this class helps to scale from the data scale to the user interface scale and vise versa.
-
-
-
-
- Initializes a new instance of the class.
-
- The draw margin location.
- Size of the draw margin.
- The axis.
- Indicates if the scaler should be built based on the previous known data.
- The axis is not ready to be scaled.
-
-
-
- Converts to pixels.
-
- The value.
-
-
-
-
- Converts to chart values.
-
- The pixels.
-
-
-
-
- Defines the stack position.
-
- The type of the drawing context.
-
-
-
- Gets or sets the stacker.
-
-
- The stacker.
-
-
-
-
- Gets or sets the position.
-
-
- The position.
-
-
-
-
- Stacks the point.
-
- The point.
-
-
-
-
- Gets the stack.
-
- The point.
-
-
-
-
- Defines the tooltip finding strategy.
-
-
-
-
- Compares X and Y coordinates.
-
-
-
-
- Compares X coordinates and ignores Y.
-
-
-
-
- Compares Y coordinates and ignores X.
-
-
-
-
- Defines the tool tip position.
-
-
-
-
- The hidden position, tool tips will be hidden.
-
-
-
-
- The top position, places the tool tip at the top of the hovered point.
-
-
-
-
- The bottom position, places the tool tip at the bottom of the hovered point.
-
-
-
-
- The left position, places the tool tip at the left of the hovered point.
-
-
-
-
- The right position, places the tool tip at the right of the hovered point.
-
-
-
-
- The center position, places the tool tip at the center of the hovered point.
-
-
-
-
- Defines the zooming and panning mode.
-
-
-
-
- Disables zooming and panning.
-
-
-
-
- Zooms only in the X axis.
-
-
-
-
- Zooms only in the Y axis.
-
-
-
-
- Zooms on both axes.
-
-
-
-
- Defines the zooming direction.
-
-
-
-
- The zoom in
-
-
-
-
- The zoom out
-
-
-
-
- Defines a float motion property.
-
-
-
-
- Initializes a new instance of the class.
-
- Name of the property.
-
-
-
- Initializes a new instance of the class.
-
- Name of the property.
- The value.
-
-
-
-
-
-
- Defines a motions property.
-
-
-
-
- Gets or sets a value indicating whether this instance is completed.
-
-
- true if this instance is completed; otherwise, false.
-
-
-
-
- Gets the name of the property.
-
-
- The name of the property.
-
-
-
-
- Gets or sets the animation.
-
-
- The animation.
-
-
-
-
- The object tracks where a property of a is in a time line.
-
-
-
-
-
- From value
-
-
-
-
- To value
-
-
-
-
- Initializes a new instance of the class.
-
- Name of the property.
-
-
-
- Gets the value where the transition began.
-
-
-
-
- Gets the value where the transition finished or will finish.
-
-
-
-
- Gets or sets the animation to define the transition.
-
-
-
-
- Gets the property name.
-
-
-
-
- Gets or sets a value indicating whether this instance is completed.
-
-
- true if this instance is completed; otherwise, false.
-
-
-
-
- Moves to he specified value.
-
- The value to move to.
- The instance that is moving.
-
-
-
- Gets the current movement in the .
-
-
-
-
-
-
- Called to get the movement at a specific progress.
-
- The progress.
-
-
-
-
- Defines a pie chart.
-
- The type of the drawing context.
-
-
-
-
- Initializes a new instance of the class.
-
- The view.
- The default platform configuration.
- The canvas.
-
-
-
- Gets the series.
-
-
- The series.
-
-
-
-
- Gets the drawable series.
-
-
- The drawable series.
-
-
-
-
- Gets the view.
-
-
- The view.
-
-
-
-
- Gets the value bounds.
-
-
- The value bounds.
-
-
-
-
- Gets the index bounds.
-
-
- The index bounds.
-
-
-
-
- Gets the pushout bounds.
-
-
- The pushout bounds.
-
-
-
-
- Finds the points near to the specified point.
-
- The pointer position.
-
-
-
-
-
-
-
- Measures this chart.
-
-
-
-
-
- Called when the updated the throttler is unlocked.
-
-
-
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Gets or sets the data labels position.
-
-
- The data labels position.
-
-
-
-
-
-
-
-
-
-
- Defines the default behavior when a point is added to a state.
-
- The visual.
- The chart.
-
-
-
- Defines the default behavior when a point is removed from a state.
-
- The visual.
- The chart.
-
-
-
- Called when the paint context changed.
-
-
-
-
- GEts the stack group
-
-
-
-
-
-
- Sets the default point transitions.
-
- The chart point.
- Unable to initialize the point instance.
-
-
-
- Softs the delete point.
-
- The point.
- The primary scale.
- The secondary scale.
-
-
-
- Gets the label polar position.
-
- The center x.
- The center y.
- The radius.
- The start angle.
- The sweep angle.
- Size of the label.
- The position.
-
-
-
-
- Deletes the point from the chart.
-
-
-
-
-
-
- Defines the row series
-
- The type of the model.
- The type of the visual.
- The type of the label.
- The type of the drawing context.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Defines a scatter series.
-
- The type of the model.
- The type of the visual.
- The type of the label.
- The type of the drawing context.
-
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Gets or sets the minimum size of the geometry.
-
-
- The minimum size of the geometry.
-
-
-
-
- Gets or sets the size of the geometry.
-
-
- The size of the geometry.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Defines a series in a Cartesian chart.
-
- The type of the model.
- The type of the visual.
- The type of the label.
- The type of the drawing context.
-
-
-
-
-
-
-
- The subscribed to
-
-
-
-
- The implements icp
-
-
-
-
- The pivot
-
-
-
-
- The data provider
-
-
-
-
- The ever fetched
-
-
-
-
- Initializes a new instance of the class.
-
- The properties.
-
-
-
-
-
-
-
-
-
- Gets or sets the data set to draw in the chart.
-
-
-
-
-
-
-
- Gets or sets the mapping that defines how a type is mapped to a instance,
- then the will be drawn as a point in the chart.
-
-
-
-
-
-
-
-
-
-
- Occurs when an instance of is measured.
-
-
-
-
- Occurs when an instance of is created.
-
-
-
-
- Occurs when a property changes.
-
-
-
-
-
-
-
- Gets or sets a delegate that will be called every time a instance
- is added to a state.
-
-
-
-
- Gets or sets a delegate that will be called every time a instance
- is removed from a state.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Softs the delete point.
-
- The point.
- The primary scale.
- The secondary scale.
-
-
-
-
- Called when a point was measured.
-
- The chart point.
-
-
-
- Called when a point is created.
-
- The chart point.
-
-
-
- Sets the default point transitions.
-
- The chart point.
-
-
-
-
- Called when a point was added to a sate.
-
- The visual.
- The chart.
-
-
-
- Called when a point was removed from a state.
-
- The visual.
- The chart.
-
-
-
- Defines the default behavior when a point is added to a state.
-
- The visual.
- The chart.
-
-
-
- Defines the default behavior when a point is removed from a state.
-
- The visual.
- The chart.
-
-
-
- Called when a property changed.
-
- Name of the property.
-
-
-
-
- Defines the stacked area series class.
-
- The type of the model.
- The type of the visual.
- The type of the label.
- The type of the drawing context.
- The type of the path geometry.
- The type of the line segment.
- The type of the bezier segment.
- The type of the move to command.
- The type of the path arguments.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Defines the stacked bar series class.
-
- The type of the model.
- The type of the visual.
- The type of the label.
- The type of the drawing context.
-
-
-
-
-
- The stack group
-
-
-
-
- Initializes a new instance of the class.
-
- The series properties.
-
-
-
- Gets or sets the stack group.
-
-
- The stack group.
-
-
-
-
- Gets or sets the maximum width of the bar.
-
-
- The maximum width of the bar.
-
-
-
-
-
-
-
-
-
-
- Called when the paint context changed.
-
-
-
-
- Gets the stack group.
-
-
-
-
-
-
- Defines the stacked column series class.
-
- The type of the model.
- The type of the visual.
- The type of the label.
- The type of the drawing context.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Measures this series.
-
- The chart.
- The secondary axis.
- The primary axis.
- Unexpected null stacker
-
-
-
- Gets the bounds.
-
- The chart.
- The secondary axis.
- The primary axis.
-
-
-
-
- Sets the default point transitions.
-
- The chart point.
- Unable to initialize the point instance.
-
-
-
- Softs the delete point.
-
- The point.
- The primary scale.
- The secondary scale.
-
-
-
- Defines a stacked row series.
-
- The type of the model.
- The type of the visual.
- The type of the label.
- The type of the drawing context.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Measures this series.
-
- The chart.
- The secondary axis.
- The primary axis.
- Unexpected null stacker
-
-
-
- Gets the bounds.
-
- The chart.
- The secondary axis.
- The primary axis.
-
-
-
-
- Sets the default point transitions.
-
- The chart point.
- Unable to initialize the point instance.
-
-
-
- Softs the delete point.
-
- The point.
- The primary scale.
- The secondary scale.
-
-
-
- Defines a set of predefined colors to use.
-
-
-
-
- Gets the fluent design colors.
-
-
- The fluent design.
-
-
-
-
- Gets the material design500 colors.
-
-
- The material design500.
-
-
-
-
- Gets the material design200 colors.
-
-
- The material design200.
-
-
-
-
- Gets the material design800 colors.
-
-
- The material design800.
-
-
-
-
- Defines the LiveCharts styler extensions.
-
-
-
-
- Defines a style builder for objects.
-
- The type of the drawing context.
- The styler.
- The predicate.
-
-
-
-
- Defines a style builder for objects.
-
- The type of the drawing context.
- The styler.
- The predicate.
-
-
-
-
- Defines a style builder for objects.
-
- The type of the drawing context.
- The styler.
- The predicate.
-
-
-
-
- Defines a style builder for objects.
-
- The type of the drawing context.
- The styler.
- The predicate.
-
-
-
-
- Defines a style builder for objects when used as gauges.
-
- The type of the drawing context.
- The styler.
- The predicate.
-
-
-
-
- Defines a style builder for objects when used as gauges fills.
-
- The type of the drawing context.
- The styler.
- The predicate.
-
-
-
-
- Defines a style builder for objects.
-
- The type of the drawing context.
- The styler.
- The predicate.
-
-
-
-
- Defines a style builder for tacked objects.
-
- The type of the drawing context.
- The styler.
- The predicate.
-
-
-
-
- Defines a style builder for objects.
-
- The type of the drawing context.
- The styler.
- The predicate.
-
-
-
-
- Defines a style builder for vertical objects.
-
- The type of the drawing context.
- The styler.
- The predicate.
-
-
-
-
- Defines a style builder for horizontal objects.
-
- The type of the drawing context.
- The styler.
- The predicate.
-
-
-
-
- Defines a style builder for stacked objects.
-
- The type of the drawing context.
- The styler.
- The predicate.
-
-
-
-
- Defines a style builder for stacked vertical objects.
-
- The type of the drawing context.
- The styler.
- The predicate.
-
-
-
-
- Defines a style builder for stacked horizontal objects.
-
- The type of the drawing context.
- The styler.
- The predicate.
-
-
-
-
- Defines a style builder for objects.
-
- The type of the drawing context.
- The styler.
- The predicate.
-
-
-
-
- Defines a style builder.
-
- The type of the drawing context.
-
-
-
- Gets the current colors.
-
-
- The current colors.
-
-
-
-
- Gets the style.
-
-
- The style.
-
-
-
-
- Gets or sets the series default resolver.
-
-
- The series default resolver.
-
-
-
-
- Gets or sets the axis default resolver.
-
-
- The axis default resolver.
-
-
-
-
- Uses the colors.
-
- The colors.
- The current theme instance
-
-
-
- Creates a new styles builder and configures it using the given predicate.
-
- The predicate.
- The current theme instance
-
-
-
- Sets the series defaults resolver.
-
- The resolver.
-
-
-
-
- Sets the axis defaults resolver.
-
- The resolver.
-
-
-
-
- Gets the objects builder.
-
- The current theme instance
-
-
-
- Resolves the series defaults.
-
- The colors.
- The series.
- Forces the apply of the theme.
-
-
-
- Resolves the axis defaults.
-
- The axis.
- /// Forces the apply of the theme.
-
-
-
- Defines an object that must initialize live charts visual objects, this object defines how things will
- be drawn by default, it is highly related to themes.
-
-
-
-
- Gets or sets the chart builder.
-
-
- The chart builder.
-
-
-
-
- Gets or sets the axis builder.
-
-
- The axis builder.
-
-
-
-
- Gets or sets the series builder.
-
-
- The pie series builder.
-
-
-
-
- Gets or sets the pie series builder.
-
-
- The pie series builder.
-
-
-
-
- Gets or sets the gauge series builder.
-
-
- The pie series builder.
-
-
-
-
- Gets or sets the gauge fill series builder.
-
-
- The pie series builder.
-
-
-
-
- Gets or sets the Cartesian series builder.
-
-
- The pie series builder.
-
-
-
-
- Gets or sets the line series builder.
-
-
- The pie series builder.
-
-
-
-
- Gets or sets the stacked line series builder.
-
-
- The pie series builder.
-
-
-
-
- Gets or sets the bar series builder.
-
-
- The pie series builder.
-
-
-
-
- Gets or sets the column series builder.
-
-
- The pie series builder.
-
-
-
-
- Gets or sets the row series builder.
-
-
- The pie series builder.
-
-
-
-
- Gets or sets the stacked bar series builder.
-
-
- The pie series builder.
-
-
-
-
- Gets or sets the stacked column series builder.
-
-
- The pie series builder.
-
-
-
-
- Gets or sets the stacked row series builder.
-
-
- The pie series builder.
-
-
-
-
- Gets or sets the scatter series builder.
-
-
- The pie series builder.
-
-
-
-
- Constructs a chart.
-
- The chart.
-
-
-
- Constructs an axis.
-
- The axis.
-
-
-
- Constructs a series.
-
- The series.
-
-
-
diff --git a/docs/_assets/install-chart.gif b/docs/_assets/install-chart.gif
new file mode 100644
index 000000000..b1c40113f
Binary files /dev/null and b/docs/_assets/install-chart.gif differ
diff --git a/docs/_assets/labelsdensity.gif b/docs/_assets/labelsdensity.gif
new file mode 100644
index 000000000..60fa0b428
Binary files /dev/null and b/docs/_assets/labelsdensity.gif differ
diff --git a/docs/_assets/tooltip-format1.png b/docs/_assets/tooltip-format1.png
new file mode 100644
index 000000000..71a139d46
Binary files /dev/null and b/docs/_assets/tooltip-format1.png differ
diff --git a/docs/_assets/tooltip-format2.png b/docs/_assets/tooltip-format2.png
new file mode 100644
index 000000000..8e1b01a18
Binary files /dev/null and b/docs/_assets/tooltip-format2.png differ
diff --git a/docs/_assets/tooltip-format3.png b/docs/_assets/tooltip-format3.png
new file mode 100644
index 000000000..9797bfbce
Binary files /dev/null and b/docs/_assets/tooltip-format3.png differ
diff --git a/docs/_assets/tooltip-format4.png b/docs/_assets/tooltip-format4.png
new file mode 100644
index 000000000..9b89c0d85
Binary files /dev/null and b/docs/_assets/tooltip-format4.png differ
diff --git a/docs/about/mvvm.md b/docs/about/mvvm.md
index ad0a1decb..c7f6bc91a 100644
--- a/docs/about/mvvm.md
+++ b/docs/about/mvvm.md
@@ -51,9 +51,7 @@ frameworks by the library and to implement `INotifyPropertyChanged` to handle au
## This site uses CommunityToolkit.Mvvm package
Probably the less lovely thing about MVVM is how verbose it was, now with source generators, the dotnet foundation is maintaining the
-[CommunityToolkit.Mvvm](https://www.nuget.org/packages/CommunityToolkit.Mvvm/), this is a game changer IMO, it makes MVVM supper easy,
-basically you only need to make your view models `partial` classes, then add the `ObservableObject` attribute to the class and
-the `ObservableProperty` attribute a field inside your class.
+[CommunityToolkit.Mvvm](https://www.nuget.org/packages/CommunityToolkit.Mvvm/), it makes MVVM easier.
To define a series property that notifies the change to the UI, without any MVVM framework a view model would look like:
@@ -88,13 +86,13 @@ Too much code to declare a property isn't it? but now we can use the `CommunityT
using LiveChartsCore;
using CommunityToolkit.Mvvm.ComponentModel;
-[ObservableObject]
-public partial class ViewModel
+public partial class ViewModel : ObservableObject
{
[ObservableProperty]
public ISeries[] _series;
}
-Notice the `ObservableProperty` attribute was added to the *_series* field. By convention and with the magic of source generators the property
-`Series` now exists in our class, source generators are adding all this boring and repetitive code for us, this is just a quick guide
-to get started with the docs in this site but you can learn more about the toolkit [here](https://www.youtube.com/watch?v=aCxl0z04BN8).
+Now we inherited from `ObservableObject` and marked the *_series* field with the `ObservableProperty` attribute; by convention and with
+the magic of source generators, the property `Series` now exists in our class, source generators are adding all this boring and repetitive
+code for us, this is just a quick guide to get started with the docs in this site but you can learn more about the
+toolkit [here](https://www.youtube.com/watch?v=aCxl0z04BN8) or in the [official docs](https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/).
diff --git a/docs/cartesianChart/axes.md b/docs/cartesianChart/axes.md
index ed8ba8895..3da8222ad 100644
--- a/docs/cartesianChart/axes.md
+++ b/docs/cartesianChart/axes.md
@@ -513,6 +513,36 @@ YAxes = new List<Axis>
}
};
+## Custom Separators
+
+The library calculates the separators based on the data and the size of the chart, but we can manually set our own separators,
+When the `CustomSeparators` property is not null, the library will not calculate the separators, instead it will use the
+collection we passed here.
+
+public Axis[] YAxes { get; set; } =
+ {
+ new Axis
+ {
+ // We can specify a custom separator collection
+ // the library will use this separators instead of
+ // calculating them based on the data of the chart
+ CustomSeparators = new double[] { 0, 10, 25, 50, 100 },
+ SeparatorsPaint = new SolidColorPaint(SKColors.Black.WithAlpha(100))
+ }
+ };
+
+![image]({{ assets_url }}/docs/samples/axes/customSeparatorsInterval/result.png)
+
+## Labels Density
+
+Separators are calculated automatically when the `CustomSeparators` and `Labels` properties are not set, the library decides
+the number of separators and distance between each one, based on the data, the size of the chart, and also based on the
+`LabelsDensity` property, this property is a factor that determines the distance between labels; Where 0 is the most dense,
+any value greater than 0 will make the labels to be more separated, values less than 0 will make the labels to overlap
+(labels rotation could prevent overlapping). Default value is 0.85.
+
+![image]({{ assets_url }}/docs/_assets/labelsdensity.gif)
+
## Inverted property
Normally both `X` and `Y` axes scale according to the Cartesian coordinate system you can invert the direction of the axes
diff --git a/docs/cartesianChart/columnseries.md b/docs/cartesianChart/columnseries.md
index a0788e91b..91419cacc 100644
--- a/docs/cartesianChart/columnseries.md
+++ b/docs/cartesianChart/columnseries.md
@@ -118,40 +118,25 @@ Finally we could aso set the padding to `0`.
{
Values = new [] { 4, 4, 7, 2, 8 },
MaxBarWidth = double.MaxValue,
- GroupPadding = 0 // mark
+ Padding = 0 // mark
}
};
-## GroupPadding property
+## Padding property
-Defines the distance between every group of columns in the plot, a group of columns is all the column that share the same
-secondary value coordinate, in the following image there are 5 groups of columns, the first one the columns that share the
-`0` coordinate, the second one shares the `1`, the third group shares the `2` coordinate, the forth group shares the `3` coordinate,
-finally the fifth group shares the `4` coordinate.
-
-:::info
-To highlight this feature the following code uses the ColumnSeries class, but it works the same for the StackedColumnSeries
-notice the sample above is using the GroupPadding property also.
-:::
-
-![image]({{ assets_url }}/docs/_assets/columngp.png)
+Gets or sets the padding for each bar in the series.
Series = new ISeries[]
{
new ColumnSeries<int>
{
Values = new [] { 4, 4, 7, 2, 8 },
- GroupPadding = 50 // mark
+ adding = 5 // mark
},
new ColumnSeries<int>
{
Values = new [] { 2, 3,1, 4, 6 },
- GroupPadding = 50 // mark
- },
- new ColumnSeries<int>
- {
- Values = new [] { 6, 3, 6, 9, 4 },
- GroupPadding = 50 // mark
+ Padding = 5 // mark
}
};
diff --git a/docs/cartesianChart/overview.md b/docs/cartesianChart/overview.md
index c064f93c0..efbd4b5c0 100644
--- a/docs/cartesianChart/overview.md
+++ b/docs/cartesianChart/overview.md
@@ -96,63 +96,63 @@ cover the most common scenarios.
There are multiple series available in the library, you can add one or mix them all in the same chart, every series has unique properties,
any image bellow is a link to an article explaining more about them.
-
+
Line series
-
+
Column series
-
+
Scatter series
-
+
Step line series
-
+
Heat series
-
+
Candle sticks series
-
+
Stacked line series
-
+
Stacked column series
-
+
Stacked step line series
diff --git a/docs/cartesianChart/stackedcolumnseries.md b/docs/cartesianChart/stackedcolumnseries.md
index 7572e9595..606382ebe 100644
--- a/docs/cartesianChart/stackedcolumnseries.md
+++ b/docs/cartesianChart/stackedcolumnseries.md
@@ -146,39 +146,25 @@ Finally we could aso set the padding to `0`.
{
Values = new [] { 4, 4, 7, 2, 8 },
MaxBarWidth = double.MaxValue,
- GroupPadding = 0 // mark
+ Padding = 0 // mark
}
};
-## GroupPadding property
+## Padding property
-:::info
-this section uses the `ColumnSeries` class, but it works the same for the `StackedColumnSeries`.
-:::
-
-Defines the distance between every group of columns in the plot, a group of columns is all the column that share the same
-secondary value coordinate, in the following image there are 5 groups of columns, the first one the columns that share the
-`0` coordinate, the second one shares the `1`, the third group shares the `2` coordinate, the forth group shares the `3` coordinate,
-finally the fifth group shares the `4` coordinate.
-
-![image]({{ assets_url }}/docs/_assets/columngp.png)
+Gets or sets the padding for each bar in the series.
Series = new ISeries[]
{
- new ColumnSeries<int>
+ new StackedColumnSeries<int>
{
Values = new [] { 4, 4, 7, 2, 8 },
- GroupPadding = 50 // mark
+ adding = 5 // mark
},
- new ColumnSeries<int>
+ new StackedColumnSeries<int>
{
Values = new [] { 2, 3,1, 4, 6 },
- GroupPadding = 50 // mark
- },
- new ColumnSeries<int>
- {
- Values = new [] { 6, 3, 6, 9, 4 },
- GroupPadding = 50 // mark
+ Padding = 5 // mark
}
};
diff --git a/docs/cartesianChart/tooltips.md b/docs/cartesianChart/tooltips.md
index f50f2c803..05f199b2d 100644
--- a/docs/cartesianChart/tooltips.md
+++ b/docs/cartesianChart/tooltips.md
@@ -141,67 +141,124 @@ the properly [unit width]({{ website_url }}/docs/{{ platform }}/{{ version }}/Ca
cartesianChart1.TooltipFindingStrategy = LiveChartsCore.Measure.TooltipFindingStrategy.CompareOnlyX;
{{~ end ~}}
-## Tooltip point text
+## Tooltip text
-You can define the text the tooltip will display for a given point, using the `Series.TooltipLabelFormatter` property, this
-property is of type `Func
` this means that is is a function, that takes a point as parameter
-and returns a string, the point will be injected by LiveCharts in this function to get a string out of it when it
+You can define the text the tooltip will display for a given point, using the
+`YToolTipLabelFormatter`, `XToolTipLabelFormatter` or `ToolTipLabelFormatter` properties, these
+properties are of type `Func` it means that both are a function, that takes a point as parameter
+and return a string, the point will be injected by LiveCharts in this function to get a string out of it when it
requires to build the text for a point in a tooltip, the injected point will be different as the user moves the pointer over the
user interface.
-By default the library already defines a default `TooltipLabelFormatter` for every series, all the series have a different
-formatter, but generally the default value uses the `Series.Name` and the `ChartPoint.PrimaryValue` properties, the following
+By default the library already defines a default formatter for every series, all the series have a different
+formatters, but generally the default value uses the `Series.Name` and the `ChartPoint.Coordinate.PrimaryValue` properties, the following
code snippet illustrates how to build a custom tooltip formatter.
-new LineSeries<double>
-{
- Name = "Sales",
- Values = new ObservableCollection<double> { 200, 558, 458 },
- // for the following formatter
- // when the pointer is over the first point (200), the tooltip will display:
- // Sales: 200
- TooltipLabelFormatter =
- (chartPoint) => $"{chartPoint.Context.Series.Name}: {chartPoint.PrimaryValue}"
-},
-
-new ColumnSeries<double>
-{
- Name = "Sales 2",
- Values = new ObservableCollection<double> { 250, 350, 240 },
- // now it will use a currency formatter to display the primary value
- // result: Sales 2: $200.00
- TooltipLabelFormatter =
- (chartPoint) => $"{chartPoint.Context.Series.Name}: {chartPoint.PrimaryValue:C2}"
-},
-
-new StepLineSeries<ObservablePoint>
-{
- Name = "Average",
- Values = new ObservableCollection<ObservablePoint>
+Lets take the example of the next series:"
+
+public ISeries[] Series { get; set; } = [
+ new LineSeries<double>
+ {
+ Values = [2, 1, 3, 5, 3, 4, 6],
+ Fill = null,
+ GeometrySize = 20,
+ },
+ new LineSeries<int, StarGeometry>
+ {
+ Values = [4, 2, 5, 2, 4, 5, 3],
+ Fill = null,
+ GeometrySize = 20
+ }
+];
+
+By default the tooltip will be:
+
+![tooltip]({{ assets_url }}/docs/assets/tooltip-format1.png)
+
+We can add format to the tooltip:
+
+public ISeries[] Series { get; set; } = [
+ new LineSeries<double>
{
- new ObservablePoint(10, 5),
- new ObservablePoint(5, 8)
+ Values = [2, 1, 3, 5, 3, 4, 6],
+ Fill = null,
+ GeometrySize = 20,
+ YToolTipLabelFormatter = point => point.Model.ToString("N2") // mark
},
- // We can also display both coordinates (X and Y in a cartesian coordinate system)
- // result: Average: 10, 5
- TooltipLabelFormatter =
- (chartPoint) => $"{chartPoint.Context.Series.Name}: {chartPoint.SecondaryValue}, {chartPoint.PrimaryValue}"
-},
+ new LineSeries<int, StarGeometry>
+ {
+ Values = [4, 2, 5, 2, 4, 5, 3],
+ Fill = null,
+ GeometrySize = 20,
+ YToolTipLabelFormatter = point => point.Model.ToString("N2") // mark
+ }
+];
+
+![tooltip]({{ assets_url }}/docs/assets/tooltip-format2.png)
+
+We used the Model property of the point, the Model property is just the item in the Values
+collection, for example in the next case, the Model property is of type `City`.
+
+public ISeries[] Series { get; set; } = [
+ new LineSeries<City>
+ {
+ Values = [new() { Population = 4 }, new() { Population = 2}],
+ YToolTipLabelFormatter = point => point.Model.Population.ToString("N2") // mark
+ }
+];
+
+// ...
-new ColumnSeries<ObservablePoint>
+public class City
{
- Values = new ObservableCollection<double> { 250, 350, 240 },
- // or anything...
- // result: Sales at this moment: $200.00
- TooltipLabelFormatter =
- (chartPoint) => $"Sales at this moment: {chartPoint.PrimaryValue:C2}"
+ public double Population { get; set; }
}
+We can also show a label for the `X` coordinate, the default tooltip uses the X label as the header in the tooltip.
+
+new LineSeries<double>
+{
+ Values = [2, 1, 3, 5, 3, 4, 6],
+ Fill = null,
+ GeometrySize = 20,
+ XToolTipLabelFormatter = point => point.Index.ToString(), // mark
+ YToolTipLabelFormatter = point => point.Model.ToString("C2")
+};
+
+![tooltip]({{ assets_url }}/docs/assets/tooltip-format3.png)
+
+When the series is "Stacked" (`PieSeries`, `StackedColumn` or `StackedRow`) we can find information about the stacked data
+in the `StackedValue` property, for example:
+
+
+public ISeries[] Series { get; set; } = [
+ new StackedColumnSeries<double>
+ {
+ Values = [2, 1, 3, 5, 3, 4, 6],
+ YToolTipLabelFormatter =
+ point => $"{point.Model} / {point.StackedValue!.Total} ({point.StackedValue.Share:P2})"
+ },
+ new StackedColumnSeries<int>
+ {
+ Values = [4, 2, 5, 2, 4, 5, 3],
+ YToolTipLabelFormatter =
+ point => $"{point.Model} / {point.StackedValue!.Total} ({point.StackedValue.Share:P2})"
+ }
+];
+
+Will result in:
+
+![tooltip]({{ assets_url }}/docs/assets/tooltip-format4.png)
+
+:::tip
+The PieSeries class uses the `ToolTipLabelFormatter` property to configure the text inside the tooltip.
+:::
+
# Customize default tooltips
You can quickly change the position, the font, the text size or the background color:
-## View
+#### View
{{~ if xaml ~}}
{{~ render_params_file_as_code this "~/../samples/$PlatformSamplesFolder/Axes/NamedLabels/$PlatformViewFile" ~}}
@@ -219,7 +276,7 @@ You can quickly change the position, the font, the text size or the background c
{{~ render_params_file_as_code this "~/../samples/BlazorSample/Pages/Axes/NamedLabels.razor" ~}}
{{~ end ~}}
-## View model
+#### View model
```c#
[ObservableObject]
@@ -249,11 +306,19 @@ You can also create your own tooltip, the recommended way is to use the LiveChar
use anything as tooltip as soon as it implements the `IChartTooltip` interface. In the following example we build
a custom control to render tooltips in out charts using the LiveCharts API.
-## CustomTooltip.cs
+:::tip
+The next tooltip is drawn by the library, LiveCharts can only draw inside the control bounds, in some cases it could
+cause issues like [#912](https://github.com/beto-rodriguez/LiveCharts2/issues/912).
+
+Alternatively, you can build your own Tooltips and use the power of your UI framework,
+see [#1558](https://github.com/beto-rodriguez/LiveCharts2/issues/1558) for more info.
+:::
+
+#### CustomTooltip.cs
{{~ render_params_file_as_code this "~/../samples/ViewModelsSamples/General/TemplatedTooltips/CustomTooltip.cs" ~}}
-## View
+#### View
{{~ render_params_file_as_code this "~/../samples/$PlatformSamplesFolder/General/TemplatedTooltips/$PlatformViewFile" ~}}
diff --git a/docs/overview/1.2.install.md b/docs/overview/1.2.install.md
index cfe356661..bd9404038 100644
--- a/docs/overview/1.2.install.md
+++ b/docs/overview/1.2.install.md
@@ -16,8 +16,11 @@ Open visual studio 2022, select "Create a new project", then select the WPF Appl
-Name the project and the solution WpfSample, and select .NET 6.0 as the framework, if the framework is not available for you, you can also use
-.NET 5.0, .NET core 3.1 or .NET 4.6.2 or greater.
+Name the project and the solution WpfSample, select .NET 8.0 as the target framework.
+
+:::tip
+LiveCharts is also compatible with older versions of .NET even with 4.6.2.
+:::
## Install from NuGet
@@ -32,22 +35,19 @@ After the package is installed add a new class to your project as follows:
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
+using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
-namespace WpfSample
+namespace WpfSample;
+
+public class ViewModel
{
- public class ViewModel
- {
- public ISeries[] Series { get; set; }
- = new ISeries[]
- {
- new LineSeries<double>
- {
- Values = new double[] { 2, 1, 3, 5, 3, 4, 6 },
- Fill = null
- }
- };
- }
-}
+ public ISeries[] Series { get; set; } = [
+ new ColumnSeries<int>(3, 4, 2),
+ new ColumnSeries<int>(4, 2, 6),
+ new ColumnSeries<double, DiamondGeometry>(4, 3, 4)
+ ];
+}
+
## Add the chart control to the UI
@@ -74,14 +74,21 @@ then add a `CartesianChart` control and bind the `Series` property:
And that's it, start your application and you will see the chart in your main window.
+
+
+
+
{{~ end ~}}
{{~ if avalonia ~}}
-Create a new Avalonia project and name the project and the solution AvaloniaSample, and select .NET 6.0 as the framework, if the framework is not
-available for you, you can also use .NET 5.0, .NET core 3.1 or .NET 4.6.2 or greater, if you need help to get started with Avalonia please see
+Create a new Avalonia project and name the project and the solution AvaloniaSample Name the project and the solution WpfSample, select .NET 8.0 as the target framework. If you need help to get started with Avalonia please see
the [Avalonia docs](https://github.com/AvaloniaUI/Avalonia#-getting-started).
+:::tip
+LiveCharts is also compatible with older versions of .NET even with 4.6.2.
+:::
+
## Install from NuGet
You can [get LiveCharts from NuGet](https://www.nuget.org/packages/LiveChartsCore.SkiaSharpView.Avalonia). If you need more help to
@@ -95,22 +102,19 @@ After the package is installed add a new class to your project as follows:
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
+using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
+
+namespace AvaloniaSample;
-namespace AvaloniaSample
+public class ViewModel
{
- public class ViewModel
- {
- public ISeries[] Series { get; set; }
- = new ISeries[]
- {
- new LineSeries<double>
- {
- Values = new double[] { 2, 1, 3, 5, 3, 4, 6 },
- Fill = null
- }
- };
- }
-}
+ public ISeries[] Series { get; set; } = [
+ new ColumnSeries<int>(3, 4, 2),
+ new ColumnSeries<int>(4, 2, 6),
+ new ColumnSeries<double, DiamondGeometry>(4, 3, 4)
+ ];
+}
+
## Add the chart control to the UI
@@ -137,6 +141,10 @@ then add a `CartesianChart` control and bind the `Series` property:
And that's it, start your application and you will see the chart in your main window.
+
+
+
+
{{~ end ~}}
{{~ if winforms ~}}
@@ -147,8 +155,11 @@ Open visual studio 2022, select "Create a new project", then select the Windows
-Name the project and the solution WinFormsSample, and select .NET 6.0 as the framework, if the framework is not available for you, you can also use
-.NET 5.0, .NET core 3.1 or .NET 4.6.2 or greater.
+Name the project and the solution WinFormsSample, select .NET 8.0 as the target framework.
+
+:::tip
+LiveCharts is also compatible with older versions of .NET even with 4.6.2.
+:::
## Install from NuGet
@@ -419,7 +430,7 @@ Start the project for the rest of the platforms, the chart is ready to run every
{{~ if winui ~}}
-Open visual studio 2022, select "Create a new project", then select the Blank App, Packed with WAP (WinUI 3 In Desktop) template.
+Open visual studio 2022, select "Create a new project", then select the "Blank App, Packed (WinUI 3 In Desktop)" template.
@@ -440,21 +451,17 @@ After the package is installed add a new class to your project as follows:
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
+using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
-namespace WinUISample
+namespace WinUISample;
+
+public class ViewModel
{
- public class ViewModel
- {
- public ISeries[] Series { get; set; }
- = new ISeries[]
- {
- new LineSeries<double>
- {
- Values = new double[] { 2, 1, 3, 5, 3, 4, 6 },
- Fill = null
- }
- };
- }
+ public ISeries[] Series { get; set; } = [
+ new ColumnSeries<int>(3, 4, 2),
+ new ColumnSeries<int>(4, 2, 6),
+ new ColumnSeries<double, DiamondGeometry>(4, 3, 4)
+ ];
}
## Add the chart control to the UI
@@ -483,6 +490,10 @@ then add a `CartesianChart` control and bind the `Series` property:
And that's it, start your application and you will see the chart in your main window.
+
+
+
+
{{~ end ~}}
{{~ if blazor ~}}
@@ -565,7 +576,7 @@ namespace MauiApp
{
var builder = MauiApp.CreateBuilder();
builder
- .UseSkiaSharp(true) // mark
+ .UseSkiaSharp() // mark
.UseMauiApp()
.ConfigureFonts(fonts =>
{
@@ -583,21 +594,19 @@ Now let's add a simple chart, add a new class to your project as follows:
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
+using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
namespace MauiSample;
public class ViewModel
{
- public ISeries[] Series { get; set; }
- = new ISeries[]
- {
- new LineSeries<double>
- {
- Values = new double[] { 2, 1, 3, 5, 3, 4, 6 },
- Fill = null
- }
- };
-}
+ public ISeries[] Series { get; set; } = [
+ new ColumnSeries<int>(3, 4, 2),
+ new ColumnSeries<int>(4, 2, 6),
+ new ColumnSeries<double, DiamondGeometry>(4, 3, 4)
+ ];
+}
+
## Add the chart control to the UI
@@ -625,8 +634,19 @@ then add a `CartesianChart` control and bind the `Series` property.
And that's it, start your application and you will see the chart.
+
+
+
+
{{~ end ~}}
+:::info
+If the chart is not showing, it is most likely that the layout where you placed the chart is hiding the control.
+LiveCharts controls do not have any size constraints, a quick fix is to explicitly set the size of the control
+(Width and Height), these related issues might help you [#1483](https://github.com/beto-rodriguez/LiveCharts2/issues/1483),
+[#1581](https://github.com/beto-rodriguez/LiveCharts2/issues/1581).
+:::
+
## Configure themes, fonts or mappers (Optional)
Optionally you could configure LiveCharts to add a theme, register a global font, enable `right to left` tooltips
diff --git a/docs/overview/1.6.paint tasks.md b/docs/overview/1.6.paint tasks.md
index e01b8d8a8..e84fa3d97 100644
--- a/docs/overview/1.6.paint tasks.md
+++ b/docs/overview/1.6.paint tasks.md
@@ -134,8 +134,7 @@ Series = new ISeries[]
Values = new []{ 7 },
Stroke = null,
Fill = new RadialGradientPaint(colors),
- Pushout = 10,
- MaxOuterRadius = 0.9
+ Pushout = 10
},
new PieSeries<int>
{
diff --git a/docs/piechart/gauges.md b/docs/piechart/gauges.md
index 1ab74dc6c..439ee517a 100644
--- a/docs/piechart/gauges.md
+++ b/docs/piechart/gauges.md
@@ -4,219 +4,19 @@
## Gauges
-You can also create gauges with the `PieChart` control, the library provides the `GaugeBuilder` class,
-it is a helper class that build a collection of `PieSeries` based on the properties
-we specify, take a look at the following sample.
+You can also create gauges with the `PieChart` control, the library provides the `GaugeGenerator` class,
+it is a helper class that builds a collection of `PieSeries` based on the properties
+we specify, this documentation contains multiple gauges samples,
+[here you can find the basic gauge sample](https://livecharts.dev/docs/{{ platform }}/{{ version }}/samples.pies.gauge1).
-{{~ if xaml || blazor ~}}
-GaugeTotal = 100; // 100 is the max value for this gauge.
-Series = new GaugeBuilder()
- .WithLabelsSize(50)
- .WithInnerRadius(50)
- .WithBackgroundInnerRadius(50)
- .AddValue(30)
- .BuildSeries();
-{{~ end ~}}
+The `GaugeGenerator.BuildSolidGauge()` function, takes one or multiple `GaugeItem` instances as parameters,
+a `GaugeItem` instance represents an element in our gauge, the constructor of the `GaugeItem` class takes 2 arguments:
-{{~ if xaml ~}}
-<lvc:PieChart
- Series="{Binding Series}"
- Total="{Binding GaugeTotal}">
-</lvc:PieChart>
-{{~ end ~}}
+- `value`: the gauge value of type `double`.
+- `builder`: a delegate where we can configure the assigned series to the `value`, we can here set the color, the labels size and customize every property as a regular [pie series](https://livecharts.dev/docs/{{ platform }}/{{ version }}/PieChart.Pie%20series).
-{{~ if blazor ~}}
-<PieChart
- Series="Series"
- Total="GaugeTotal">
-</PieChart>
-{{~ end ~}}
+You can find an example that uses both parameters in the [slim gauge sample](https://livecharts.dev/docs/{{ platform }}/{{ version }}/samples.pies.gauge4).
-{{~ if winforms ~}}
-pieChart1.GaugeTotal = 100; // 100 is the max value for this gauge.
-pieChart1.Series = new GaugeBuilder()
- .WithLabelsSize(50)
- .WithInnerRadius(50)
- .WithBackgroundInnerRadius(50)
- .AddValue(30)
- .BuildSeries();
-{{~ end ~}}
-
-![image]({{ assets_url }}/docs/_assets/basicgauge.png)
-
-## InitialRotation property
-
-You could also use the `PieChart.InitialRotation` property to customize the angle where the gauge starts.
-
-{{~ if xaml || blazor ~}}
-InitialRotation = -90; // -90 degrees for the starting angle // mark
-GaugeTotal = 100;
-Series = new GaugeBuilder()
- .WithLabelsSize(50)
- .WithInnerRadius(50)
- .WithBackgroundInnerRadius(50)
- .AddValue(30)
- .BuildSeries();
-{{~ end ~}}
-
-{{~ if xaml ~}}
-<lvc:PieChart
- Series="{Binding Series}"
- Total="{Binding GaugeTotal}"
- InitialRotation="{Binding InitialRotation}"> <!-- mark -->
-</lvc:PieChart>
-{{~ end ~}}
-
-{{~ if blazor ~}}
-<PieChart
- Series="Series"
- Total="GaugeTotal"
- InitialRotation="InitialRotation"> <!-- mark -->
-</PieChart>
-{{~ end ~}}
-
-{{~ if winforms ~}}
-pieChart1.InitialRotation = -90; // mark
-pieChart1.GaugeTotal = 100;
-pieChart1.Series = new GaugeBuilder()
- .WithLabelsSize(50)
- .WithInnerRadius(50)
- .WithBackgroundInnerRadius(50)
- .AddValue(30)
- .BuildSeries();
-{{~ end ~}}
-
-![image]({{ assets_url }}/docs/_assets/basicgauge-90.png)
-
-## OffsetRadius property
-
-Now trying the `GaugeBuilder.OffsetRadius`, this property defines an offset in pixels from the `InnerRadius` of the
-pie slice shape to the actual start of the shape:
-
-{{~ if xaml || blazor ~}}
-InitialRotation = -90;
-GaugeTotal = 100;
-Series = new GaugeBuilder()
- .WithLabelsSize(50)
- .WithInnerRadius(50)
- .WithBackgroundInnerRadius(50)
- .WithOffsetRadius(10) // mark
- .AddValue(30)
- .BuildSeries();
-{{~ end ~}}
-
-{{~ if winforms ~}}
-pieChart1.InitialRotation = -90;
-pieChart1.GaugeTotal = 100;
-pieChart1.Series = new GaugeBuilder()
- .WithLabelsSize(50)
- .WithInnerRadius(50)
- .WithBackgroundInnerRadius(50)
- .WithOffsetRadius(10) // mark
- .AddValue(30)
- .BuildSeries();
-{{~ end ~}}
-
-![image]({{ assets_url }}/docs/_assets/basicgaugeor.png)
-
-Notice that there is a similar property the `GaugeBuilder.BackgroundOffsetRadius` will do the same effect
-but in the background slice (gray one).
-
-## Multiple series
-
-You can also compare multiple series in the same gauge, the following sample combines adds 2 more series and
-uses the `LabelFormatter` property to customize the labels.
-
-{{~ if xaml || blazor ~}}
-InitialRotation = 45;
-GaugeTotal = 100;
-Series = new GaugeBuilder()
- .WithLabelsPosition(PolarLabelsPosition.Start)
- .WithLabelFormatter(point => point.PrimaryValue + " " + point.Context.Series.Name)
- .WithLabelsSize(20)
- .WithInnerRadius(20)
- .WithOffsetRadius(8)
- .WithBackgroundInnerRadius(20)
- .AddValue(30, "Vannesa") // mark
- .AddValue(50, "Charles") // mark
- .AddValue(90, "Ana") // mark
- .BuildSeries();
-{{~ end ~}}
-
-{{~ if winforms ~}}
-pieChart1.InitialRotation = 45;
-pieChart1.GaugeTotal = 100;
-pieChart1.Series = new GaugeBuilder()
- .WithLabelsPosition(PolarLabelsPosition.Start)
- .WithLabelFormatter(point => point.PrimaryValue + " " + point.Context.Series.Name)
- .WithLabelsSize(20)
- .WithInnerRadius(20)
- .WithOffsetRadius(8)
- .WithBackgroundInnerRadius(20)
- .AddValue(30, "Vannesa") // mark
- .AddValue(50, "Charles") // mark
- .AddValue(90, "Ana") // mark
- .BuildSeries();
-{{~ end ~}}
-
-![image]({{ assets_url }}/docs/_assets/basicgaugemultiple.png)
-
-## MaxAngle property
-
-The max angle property defines the maximum angle the gauge can take, the range goes from 0 to 360 degrees (full circle),
-by default the value is 360, we can avoid the overlap of the green series in the previous sample if we reserve a space for
-the labels, in this case we will set the `MaxAngle` to 270 degrees, this way we will have space for the labels to render
-in the last 90 degrees of our circumference.
-
-{{~ if xaml || blazor ~}}
-InitialRotation = 45;
-GaugeTotal = 100;
-Series = new GaugeBuilder()
- .WithLabelsPosition(PolarLabelsPosition.Start)
- .WithLabelFormatter(point => point.PrimaryValue + " " + point.Context.Series.Name)
- .WithLabelsSize(20)
- .WithInnerRadius(20)
- .WithOffsetRadius(8)
- .WithBackgroundInnerRadius(20)
- .AddValue(30, "Vannesa")
- .AddValue(50, "Charles")
- .AddValue(90, "Ana")
- .BuildSeries();
-{{~ end ~}}
-
-{{~ if xaml ~}}
-<lvc:PieChart
- Series="{Binding Series}"
- Total="{Binding GaugeTotal}"
- InitialRotation="{Binding InitialRotation}"
- MaxAngle="270"> <!-- mark -->
-</lvc:PieChart>
-{{~ end ~}}
-
-{{~ if blazor ~}}
-<PieChart
- Series="Series"
- Total="GaugeTotal"
- InitialRotation="InitialRotation"
- MaxAngle="270"> <!-- mark -->
-</PieChart>
-{{~ end ~}}
-
-{{~ if winforms ~}}
-pieChart1.MaxAngle = 270; // mark
-pieChart1.InitialRotation = 45;
-pieChart1.GaugeTotal = 100;
-pieChart1.Series = new GaugeBuilder()
- .WithLabelsPosition(PolarLabelsPosition.Start)
- .WithLabelFormatter(point => point.PrimaryValue + " " + point.Context.Series.Name)
- .WithLabelsSize(20)
- .WithInnerRadius(20)
- .WithOffsetRadius(8)
- .WithBackgroundInnerRadius(20)
- .AddValue(30, "Vannesa")
- .AddValue(50, "Charles")
- .AddValue(90, "Ana")
- .BuildSeries();
-{{~ end ~}}
-
-![image]({{ assets_url }}/docs/_assets/basicgaugemultiple270.png)
+Finally, there is a special value to customize the background series of a gauge, using the `GaugeItem.Background` as the `value` in the
+`GaugeItem` class, will create a series behind our gauge values that will behave as the background in our plot,
+[here is an example](https://livecharts.dev/docs/{{ platform }}/{{ version }}/samples.pies.gauge2) that uses this feature.
diff --git a/docs/samples/general/customTooltips/template.md b/docs/samples/general/customTooltips/template.md
index e128f9aeb..c62aeaf1c 100644
--- a/docs/samples/general/customTooltips/template.md
+++ b/docs/samples/general/customTooltips/template.md
@@ -1,11 +1,13 @@
# Customize default tooltips
+:::tip
The next article is a quick guide on how to customize the default tooltip,if you want to learn more you can read the full
article:
Go to the full tooltips article
+:::
You can quickly change the position, the font, the text size or the background color:
@@ -51,12 +53,133 @@ public partial class ViewModel
![image]({{ assets_url }}/docs/samples/general/customTooltips/styling-tooltips.png)
-## Tooltip control from scratch
+# Customize tooltip format
+
+You can define the text the tooltip will display for a given point, using the
+`YToolTipLabelFormatter`, `XToolTipLabelFormatter` or `ToolTipLabelFormatter` properties, these
+properties are of type `Func` it means that both are a function, that takes a point as parameter
+and return a string, the point will be injected by LiveCharts in this function to get a string out of it when it
+requires to build the text for a point in a tooltip, the injected point will be different as the user moves the pointer over the
+user interface.
+
+By default the library already defines a default formatter for every series, all the series have a different
+formatters, but generally the default value uses the `Series.Name` and the `ChartPoint.Coordinate.PrimaryValue` properties, the following
+code snippet illustrates how to build a custom tooltip formatter.
+
+Lets take the example of the next series:"
+
+public ISeries[] Series { get; set; } = [
+ new LineSeries<double>
+ {
+ Values = [2, 1, 3, 5, 3, 4, 6],
+ Fill = null,
+ GeometrySize = 20,
+ },
+ new LineSeries<int, StarGeometry>
+ {
+ Values = [4, 2, 5, 2, 4, 5, 3],
+ Fill = null,
+ GeometrySize = 20
+ }
+];
+
+By default the tooltip will be:
+
+![tooltip]({{ assets_url }}/docs/assets/tooltip-format1.png)
+
+We can add format to the tooltip:
+
+public ISeries[] Series { get; set; } = [
+ new LineSeries<double>
+ {
+ Values = [2, 1, 3, 5, 3, 4, 6],
+ Fill = null,
+ GeometrySize = 20,
+ YToolTipLabelFormatter = point => point.Model.ToString("N2") // mark
+ },
+ new LineSeries<int, StarGeometry>
+ {
+ Values = [4, 2, 5, 2, 4, 5, 3],
+ Fill = null,
+ GeometrySize = 20,
+ YToolTipLabelFormatter = point => point.Model.ToString("N2") // mark
+ }
+];
+
+![tooltip]({{ assets_url }}/docs/assets/tooltip-format2.png)
+
+We used the Model property of the point, the Model property is just the item in the Values
+collection, for example in the next case, the Model property is of type `City`.
+
+public ISeries[] Series { get; set; } = [
+ new LineSeries<City>
+ {
+ Values = [new() { Population = 4 }, new() { Population = 2}],
+ YToolTipLabelFormatter = point => point.Model.Population.ToString("N2") // mark
+ }
+];
+
+// ...
+
+public class City
+{
+ public double Population { get; set; }
+}
+
+We can also show a label for the `X` coordinate, the default tooltip uses the X label as the header in the tooltip.
+
+new LineSeries<double>
+{
+ Values = [2, 1, 3, 5, 3, 4, 6],
+ Fill = null,
+ GeometrySize = 20,
+ XToolTipLabelFormatter = point => point.Index.ToString(), // mark
+ YToolTipLabelFormatter = point => point.Model.ToString("C2")
+};
+
+![tooltip]({{ assets_url }}/docs/assets/tooltip-format3.png)
+
+When the series is "Stacked" (`PieSeries`, `StackedColumn` or `StackedRow`) we can find information about the stacked data
+in the `StackedValue` property, for example:
+
+
+public ISeries[] Series { get; set; } = [
+ new StackedColumnSeries<double>
+ {
+ Values = [2, 1, 3, 5, 3, 4, 6],
+ YToolTipLabelFormatter =
+ point => $"{point.Model} / {point.StackedValue!.Total} ({point.StackedValue.Share:P2})"
+ },
+ new StackedColumnSeries<int>
+ {
+ Values = [4, 2, 5, 2, 4, 5, 3],
+ YToolTipLabelFormatter =
+ point => $"{point.Model} / {point.StackedValue!.Total} ({point.StackedValue.Share:P2})"
+ }
+];
+
+Will result in:
+
+![tooltip]({{ assets_url }}/docs/assets/tooltip-format4.png)
+
+:::tip
+The PieSeries class uses the `ToolTipLabelFormatter` property to configure the text inside the tooltip.
+:::
+
+# Tooltip control from scratch
You can also create your own tooltip, the recommended way is to use the LiveCharts API (example bellow) but you can
use anything as tooltip as soon as it implements the `IChartTooltip` interface. AT the following example we build
a custom control to render tooltips in our charts using the LiveCharts API.
+:::tip
+The next tooltip is drawn by the library, LiveCharts can only draw inside the control bounds, in some cases it could
+cause issues like [#912](https://github.com/beto-rodriguez/LiveCharts2/issues/912).
+
+Alternatively, you can build your own Tooltips and use the power of your UI framework,
+see [#1558](https://github.com/beto-rodriguez/LiveCharts2/issues/1558) for more info.
+:::
+
## CustomTooltip.cs
{{~ render_params_file_as_code this "~/../samples/ViewModelsSamples/General/TemplatedTooltips/CustomTooltip.cs" ~}}
diff --git a/docs/samples/general/multiThreading/template.md b/docs/samples/general/multiThreading/template.md
index b3eb13561..70b859112 100644
--- a/docs/samples/general/multiThreading/template.md
+++ b/docs/samples/general/multiThreading/template.md
@@ -5,7 +5,7 @@ could cause a `InvalidOperationException (Collection Was Modified)` and some oth
changing on multiple threads so it can handle it and prevent
[concurrency hazards](https://learn.microsoft.com/en-us/archive/msdn-magazine/2008/october/concurrency-hazards-solving-problems-in-your-multithreaded-code).
-There are 2 alternatives you can follow to prevent this issue, 1. use the [lock](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/lock) keyword to wrap any change in your data, 2. Invoke the changes on the UI tread.
+There are 2 alternatives you can follow to prevent this issue, 1. use the [lock](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/lock) keyword to wrap any change in your data, 2. Invoke the changes on the UI thread.
@@ -47,7 +47,7 @@ Notice that we also set the chart `SyncContext` property so the chart knows our
## Invoke the changes on the UI thread (Alternative 2)
You can also force the change to happen on the same thread where the chart is measured, this will prevent concurrency hazards because
-everything is happening on the same tread, but you must consider that now the UI tread is doing more operations.
+everything is happening on the same thread, but you must consider that now the UI thread is doing more operations.
## View model
diff --git a/docs/samples/lines/basic/result.gif b/docs/samples/lines/basic/result.gif
index c166e7eee..530bb0998 100644
Binary files a/docs/samples/lines/basic/result.gif and b/docs/samples/lines/basic/result.gif differ
diff --git a/docs/samples/lines/basic/result.png b/docs/samples/lines/basic/result.png
index 1e2b16973..b5c4446ed 100644
Binary files a/docs/samples/lines/basic/result.png and b/docs/samples/lines/basic/result.png differ
diff --git a/docs/samples/lines/xy/template.md b/docs/samples/lines/xy/template.md
index 9faab4bbc..ca97aa511 100644
--- a/docs/samples/lines/xy/template.md
+++ b/docs/samples/lines/xy/template.md
@@ -1 +1,38 @@
-{{ render this "~/shared/genericSampleSimple.md" }}
\ No newline at end of file
+# {{ name | to_title_case }}
+
+
+
+
+
+When you need to specify both, X and Y coordinates, you can use the
+[ObservablePoint](https://livecharts.dev/api/{{ version }}/LiveChartsCore.Defaults.ObservablePoint) class,
+in other examples in this repository you will notice that the library can also plot primitive types such as
+`int` or `double`, the library (usually) uses the index of the element in the array as the `X` coordinate
+and the value as the `Y` coordinate, so even we are passing an array of primitives, the library is mapping
+that object to and `(X, Y)` point, the library can build charts from any object, but we much teach LiveCharts
+how to handle that object, if you want to learn more, please read the
+[Mappers article](https://livecharts.dev/docs/{{ platform }}/{{ version }}/Overview.Mappers).
+
+## View Model
+
+```
+{{ full_name | get_vm_from_docs }}
+```
+
+{{~ if xaml ~}}
+## XAML
+{{~ end ~}}
+
+{{~ if winforms ~}}
+## Code Behind
+{{~ end ~}}
+
+{{~ if blazor~}}
+## HTML
+{{~ end~}}
+
+```
+{{ full_name | get_view_from_docs }}
+```
+
+{{ render this "~/shared/relatedTo.md" }}
diff --git a/docs/shared/datalabels.md b/docs/shared/datalabels.md
index cb2cf2f94..47e31a6f4 100644
--- a/docs/shared/datalabels.md
+++ b/docs/shared/datalabels.md
@@ -14,7 +14,7 @@ following sample:
// that takes the current point as parameter
// and returns a string.
// in this case we returned the PrimaryValue property as currency
- DataLabelsFormatter = (point) => point.PrimaryValue.ToString("C2"),
+ DataLabelsFormatter = (point) => point.Coordinate.PrimaryValue.ToString("C2"),
Values = new ObservableCollection<double> { 2, 1, 3, 5, 3, 4, 6 },
Fill = null
}
diff --git a/docs/shared/genericSampleHeader.md b/docs/shared/genericSampleHeader.md
index 9274f3861..070b4a7cf 100644
--- a/docs/shared/genericSampleHeader.md
+++ b/docs/shared/genericSampleHeader.md
@@ -1,20 +1,20 @@
# {{ name | to_title_case }}
-:::info
+
+
+
+
+
+:::tip
Hover over the image to see the chart animation
:::
{{~ if xaml ~}}
:::info
-The `[ObservableObject]`, `[ObservableProperty]` and `[RelayCommand]` attributes come from the
-[CommunityToolkit.Mvvm](https://www.nuget.org/packages/CommunityToolkit.Mvvm/) package, you can read more about it
+This sample uses C# 12 features, it also uses features from the
+[CommunityToolkit.Mvvm](https://www.nuget.org/packages/CommunityToolkit.Mvvm/) package, you can learn more about it
[here]({{ website_url }}/docs/{{ platform }}/{{ version }}/About.About%20this%20samples).
:::
-{{~ end ~}}
-
-
-
-
-
\ No newline at end of file
+{{~ end ~}}
\ No newline at end of file
diff --git a/docs/shared/genericSampleJustGifHeader.md b/docs/shared/genericSampleJustGifHeader.md
index 8a3b68470..4c615d6a7 100644
--- a/docs/shared/genericSampleJustGifHeader.md
+++ b/docs/shared/genericSampleJustGifHeader.md
@@ -3,8 +3,8 @@
{{~ if xaml ~}}
:::info
-The `[ObservableObject]`, `[ObservableProperty]` and `[RelayCommand]` attributes come from the
-[CommunityToolkit.Mvvm](https://www.nuget.org/packages/CommunityToolkit.Mvvm/) package, you can read more about it
+This sample uses C# 12 features, it also uses features from the
+[CommunityToolkit.Mvvm](https://www.nuget.org/packages/CommunityToolkit.Mvvm/) package, you can learn more about it
[here]({{ website_url }}/docs/{{ platform }}/{{ version }}/About.About%20this%20samples).
:::
diff --git a/docs/shared/genericSampleSimpleHeader.md b/docs/shared/genericSampleSimpleHeader.md
index 6b01a90a3..8bae911e7 100644
--- a/docs/shared/genericSampleSimpleHeader.md
+++ b/docs/shared/genericSampleSimpleHeader.md
@@ -3,8 +3,8 @@
{{~ if xaml ~}}
:::info
-The `[ObservableObject]`, `[ObservableProperty]` and `[RelayCommand]` attributes come from the
-[CommunityToolkit.Mvvm](https://www.nuget.org/packages/CommunityToolkit.Mvvm/) package, you can read more about it
+This sample uses C# 12 features, it also uses features from the
+[CommunityToolkit.Mvvm](https://www.nuget.org/packages/CommunityToolkit.Mvvm/) package, you can learn more about it
[here]({{ website_url }}/docs/{{ platform }}/{{ version }}/About.About%20this%20samples).
:::
diff --git a/docs/shared/polarlabels.md b/docs/shared/polarlabels.md
index 50c555453..ac9912bf5 100644
--- a/docs/shared/polarlabels.md
+++ b/docs/shared/polarlabels.md
@@ -19,7 +19,7 @@ following sample:
// for more information about available positions see:
// {{ website_url }}/api/{{ version }}/LiveChartsCore.Measure.PolarLabelsPosition
DataLabelsPosition = LiveChartsCore.Measure.PolarLabelsPosition.Middle,
- DataLabelsFormatter = point => point.PrimaryValue.ToString("N2") + " elements"
+ DataLabelsFormatter = point => point.Coordinate.PrimaryValue.ToString("N2") + " elements"
},
new PieSeries<double>
{
@@ -27,7 +27,7 @@ following sample:
DataLabelsPaint = new SolidColorPaint(SKColors.Black),
DataLabelsSize = 22,
DataLabelsPosition = LiveChartsCore.Measure.PolarLabelsPosition.Middle,
- DataLabelsFormatter = point => point.PrimaryValue.ToString("N2") + " elements"
+ DataLabelsFormatter = point => point.Coordinate.PrimaryValue.ToString("N2") + " elements"
},
new PieSeries<double>
{
@@ -35,7 +35,7 @@ following sample:
DataLabelsPaint = new SolidColorPaint(SKColors.Black),
DataLabelsSize = 22,
DataLabelsPosition = LiveChartsCore.Measure.PolarLabelsPosition.Middle,
- DataLabelsFormatter = point => point.PrimaryValue.ToString("N2") + " elements"
+ DataLabelsFormatter = point => point.Coordinate.PrimaryValue.ToString("N2") + " elements"
}
};
diff --git a/docs/shared/series.md b/docs/shared/series.md
index 60741c278..f0d0ef6be 100644
--- a/docs/shared/series.md
+++ b/docs/shared/series.md
@@ -91,19 +91,16 @@ var citiesSeries = new {{ name | to_title_case_no_spaces }}<City>
new City { Name = "New York", Population = 11 },
new City { Name = "Mexico City", Population = 10 },
},
- Mapping = (city, point) =>
+ Mapping = (city, index) =>
{
- // this function will be called for every city in our data collection
- // in this case Tokio, New York and Mexico city
- // it takes the city and the point in the chart liveCharts built for the given city
- // you must map the coordinates to the point
-
- // use the Population property as the primary value (normally Y)
- point.PrimaryValue = (float)city.Population;
-
- // use the index of the city in our data collection as the secondary value
- // (normally X)
- point.SecondaryValue = point.Context.Index;
+ // this function will be called for each instance in our values array,
+ // the function takes each instance (city) and the index of the item in the array as parameters
+ // and must return the coordinate of the city in the plot.
+
+ // in this case, we return the index as the X coordinate
+ // and the Population as the Y value.
+
+ return new Coordinate(index, city.Population.Value);
}
};
diff --git a/samples/AvaloniaSample/Lines/CustomPoints/View.axaml b/samples/AvaloniaSample/Lines/CustomPoints/View.axaml
new file mode 100644
index 000000000..59a00ac04
--- /dev/null
+++ b/samples/AvaloniaSample/Lines/CustomPoints/View.axaml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
diff --git a/samples/AvaloniaSample/Lines/CustomPoints/View.axaml.cs b/samples/AvaloniaSample/Lines/CustomPoints/View.axaml.cs
new file mode 100644
index 000000000..1abb3a6a6
--- /dev/null
+++ b/samples/AvaloniaSample/Lines/CustomPoints/View.axaml.cs
@@ -0,0 +1,17 @@
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace AvaloniaSample.Lines.CustomPoints;
+
+public partial class View : UserControl
+{
+ public View()
+ {
+ InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+}
diff --git a/samples/AvaloniaSample/Pies/Icons/View.axaml b/samples/AvaloniaSample/Pies/Icons/View.axaml
new file mode 100644
index 000000000..90405309e
--- /dev/null
+++ b/samples/AvaloniaSample/Pies/Icons/View.axaml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
diff --git a/samples/AvaloniaSample/Pies/Icons/View.axaml.cs b/samples/AvaloniaSample/Pies/Icons/View.axaml.cs
new file mode 100644
index 000000000..fb271c081
--- /dev/null
+++ b/samples/AvaloniaSample/Pies/Icons/View.axaml.cs
@@ -0,0 +1,17 @@
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace AvaloniaSample.Pies.Icons;
+
+public partial class View : UserControl
+{
+ public View()
+ {
+ InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+}
diff --git a/samples/BlazorSample/Pages/Hello.razor b/samples/BlazorSample/Pages/Hello.razor
index ee6647868..4873d4847 100644
--- a/samples/BlazorSample/Pages/Hello.razor
+++ b/samples/BlazorSample/Pages/Hello.razor
@@ -7,6 +7,7 @@
@using LiveChartsCore.SkiaSharpView;
@using System.Collections.ObjectModel;
@using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
+@using LiveChartsCore.SkiaSharpView.Extensions
@using LiveChartsCore.SkiaSharpView.Painting;
@using LiveChartsCore.SkiaSharpView.Painting.Effects;
@using LiveChartsCore.SkiaSharpView.VisualElements;
@@ -480,7 +481,7 @@ values.Add(new(5));");
var outer = 10;
PieChart.Series = new[] { 30, 20, 15, 10, 8, 4 }
- .AsLiveChartsPieSeries((value, series) =>
+ .AsPieSeries((value, series) =>
{
series.InnerRadius = 50;
series.OuterRadiusOffset = outer;
@@ -494,7 +495,7 @@ values.Add(new(5));");
.AsLiveChartsPieSeries((value, series) =>
{
series.InnerRadius = 50;
- series.MaxOuterRadius = outer;
+ series.OuterRadiusOffset = outer;
outer = outer - 0.1;
});");
@@ -514,23 +515,18 @@ values.Add(new(5));");
var charles = new ObservableValue(50);
var ana = new ObservableValue(70);
- GaugeChart.Series = new GaugeBuilder()
- .WithLabelsSize(20)
- .WithLabelsPosition(PolarLabelsPosition.Start)
- .WithLabelFormatter(point => $"{point.Coordinate.PrimaryValue} {point.Context.Series.Name}")
- .WithInnerRadius(20)
- .WithOffsetRadius(8)
- .WithBackgroundInnerRadius(20)
-
- .AddValue(vanesa, "Vanessa")
- .AddValue(charles, "Charles")
- .AddValue(ana, "Ana")
-
- .BuildSeries();
+ GaugeChart.Series = GaugeGenerator.BuildSolidGauge(
+ new GaugeItem(50, series => SetStyle("Vanessa", series)),
+ new GaugeItem(80, series => SetStyle("Charles", series)),
+ new GaugeItem(95, series => SetStyle("Ana", series)),
+ new GaugeItem(GaugeItem.Background, series =>
+ {
+ series.Fill = null;
+ }));
GaugeChart.InitialRotation = 45;
GaugeChart.MaxAngle = 270;
- GaugeChart.Total = 100;
+ GaugeChart.MaxValue = 100;
await JS.InvokeVoidAsync("hlElements",
"Gauges",
@@ -560,6 +556,17 @@ values.Add(new(5));");
ana.Value = 70;
}
+ public static void SetStyle(string name, PieSeries
series)
+ {
+ series.Name = name;
+ series.DataLabelsSize = 20;
+ series.DataLabelsPosition = PolarLabelsPosition.End;
+ series.DataLabelsFormatter =
+ point => point.Coordinate.PrimaryValue.ToString();
+ series.InnerRadius = 20;
+ series.MaxRadialColumnWidth = 5;
+ }
+
public async Task Sample6()
{
PolarChart.EasingFunction = EasingFunctions.QuadraticOut;
diff --git a/samples/BlazorSample/Pages/Lines/CustomPoints.razor b/samples/BlazorSample/Pages/Lines/CustomPoints.razor
new file mode 100644
index 000000000..08173e9b9
--- /dev/null
+++ b/samples/BlazorSample/Pages/Lines/CustomPoints.razor
@@ -0,0 +1,11 @@
+@page "/Lines/CustomPoints"
+@using LiveChartsCore.SkiaSharpView.Blazor
+@using ViewModelsSamples.Lines.CustomPoints
+
+
+
+
+@code {
+ public ViewModel ViewModel { get; set; } = new();
+}
diff --git a/samples/BlazorSample/Pages/Pies/Icons.razor b/samples/BlazorSample/Pages/Pies/Icons.razor
new file mode 100644
index 000000000..0a5fddaad
--- /dev/null
+++ b/samples/BlazorSample/Pages/Pies/Icons.razor
@@ -0,0 +1,11 @@
+@page "/Pies/Icons"
+@using LiveChartsCore.SkiaSharpView.Blazor
+@using ViewModelsSamples.Pies.Icons
+
+
+
+
+@code {
+ public ViewModel ViewModel { get; set; } = new();
+}
diff --git a/samples/ConsoleSample/ConsoleSample/Program.cs b/samples/ConsoleSample/ConsoleSample/Program.cs
index 103602a66..d3a1c7e87 100644
--- a/samples/ConsoleSample/ConsoleSample/Program.cs
+++ b/samples/ConsoleSample/ConsoleSample/Program.cs
@@ -12,11 +12,10 @@
{
Width = 900,
Height = 600,
- Series = new ISeries[]
- {
- new LineSeries { Values = new int[] { 1, 5, 4, 6 } },
- new ColumnSeries { Values = new int[] { 4, 8, 2, 4 } }
- },
+ Series = [
+ new LineSeries { Values = [1, 5, 4, 6] },
+ new ColumnSeries { Values = [4, 8, 2, 4] }
+ ],
Title = new LabelVisual
{
Text = "Hello LiveCharts",
@@ -48,12 +47,11 @@
{
Width = 900,
Height = 600,
- Series = new ISeries[]
- {
- new PieSeries { Values = new int[] { 10, } },
- new PieSeries { Values = new int[] { 6 } },
- new PieSeries { Values = new int[] { 4 } }
- },
+ Series = [
+ new PieSeries { Values = [10,] },
+ new PieSeries { Values = [6] },
+ new PieSeries { Values = [4] }
+ ],
LegendPosition = LiveChartsCore.Measure.LegendPosition.Right
};
@@ -63,18 +61,16 @@
{
Width = 900,
Height = 600,
- Series = new IGeoSeries[]
- {
+ Series = [
new HeatLandSeries
{
- Lands = new HeatLand[]
- {
+ Lands = [
new() { Name = "mex", Value = 10 },
new() { Name = "usa", Value = 15 },
new() { Name = "can", Value = 8 }
- }
+ ]
}
- }
+ ]
};
geoHeatMap.SaveImage("geoHeatMap.png");
diff --git a/samples/EtoFormsSample/Lines/CustomPoints/View.cs b/samples/EtoFormsSample/Lines/CustomPoints/View.cs
new file mode 100644
index 000000000..e2ff82227
--- /dev/null
+++ b/samples/EtoFormsSample/Lines/CustomPoints/View.cs
@@ -0,0 +1,22 @@
+using Eto.Forms;
+using LiveChartsCore.SkiaSharpView.Eto;
+using ViewModelsSamples.Lines.CustomPoints;
+
+namespace EtoFormsSample.Lines.CustomPoints;
+
+public class View : Panel
+{
+ private readonly CartesianChart cartesianChart;
+
+ public View()
+ {
+ var viewModel = new ViewModel();
+
+ cartesianChart = new CartesianChart
+ {
+ Series = viewModel.Series,
+ };
+
+ Content = cartesianChart;
+ }
+}
diff --git a/samples/EtoFormsSample/Pies/Icons/View.cs b/samples/EtoFormsSample/Pies/Icons/View.cs
new file mode 100644
index 000000000..85c27d469
--- /dev/null
+++ b/samples/EtoFormsSample/Pies/Icons/View.cs
@@ -0,0 +1,22 @@
+using Eto.Forms;
+using LiveChartsCore.SkiaSharpView.Eto;
+using ViewModelsSamples.Pies.Icons;
+
+namespace EtoFormsSample.Pies.Icons;
+
+public class View : Panel
+{
+ private readonly PieChart pieChart;
+
+ public View()
+ {
+ var viewModel = new ViewModel();
+
+ pieChart = new PieChart
+ {
+ Series = viewModel.Series
+ };
+
+ Content = pieChart;
+ }
+}
diff --git a/samples/IChartEntitySample/Program.cs b/samples/IChartEntitySample/Program.cs
index 01afd4e29..13400da40 100644
--- a/samples/IChartEntitySample/Program.cs
+++ b/samples/IChartEntitySample/Program.cs
@@ -15,15 +15,14 @@
{
Width = 900,
Height = 600,
- Series = new[]
- {
+ Series = [
new LineSeries
{
Values = samples
}
- },
- XAxes = new[] { new Axis { Labeler = value => $"{value} seconds" } },
- YAxes = new[] { new Axis { Labeler = value => $"{value} °C" } }
+ ],
+ XAxes = [new Axis { Labeler = value => $"{value} seconds" }],
+ YAxes = [new Axis { Labeler = value => $"{value} °C" }]
};
// save the chart.
diff --git a/samples/MappersSamples/Program.cs b/samples/MappersSamples/Program.cs
index 79f643b4f..8c76c8e50 100644
--- a/samples/MappersSamples/Program.cs
+++ b/samples/MappersSamples/Program.cs
@@ -19,8 +19,7 @@
{
Width = 900,
Height = 600,
- Series = new[]
- {
+ Series = [
new LineSeries
{
// we set the X coordinate to the Time property
@@ -28,9 +27,9 @@
Mapping = (tempSample, index) => new(tempSample.Time, tempSample.Temperature),
Values = samples
}
- },
- XAxes = new[] { new Axis { Labeler = value => $"{value} seconds" } },
- YAxes = new[] { new Axis { Labeler = value => $"{value} °C" } }
+ ],
+ XAxes = [new Axis { Labeler = value => $"{value} seconds" }],
+ YAxes = [new Axis { Labeler = value => $"{value} °C" }]
};
chart.SaveImage("using mappers.png");
@@ -61,8 +60,8 @@
{
Width = 900,
Height = 600,
- Series = new[]
- {
+ Series =
+ [
new ColumnSeries
{
// we set the X coordinate to the index of the item in the array
@@ -70,16 +69,16 @@
Mapping = (city, index) => new(index, city.Population),
Values = cities
}
- },
- XAxes = new[]
- {
+ ],
+ XAxes =
+ [
new Axis
{
Labels = cities.Select(x => x.Name).ToArray(),
LabelsRotation = 90
}
- },
- YAxes = new[] { new Axis { Labeler = value => value.ToString("N2") } }
+ ],
+ YAxes = [new Axis { Labeler = value => value.ToString("N2") }]
};
citiesChart.SaveImage("cities.png");
diff --git a/samples/MauiSample/Lines/CustomPoints/View.xaml b/samples/MauiSample/Lines/CustomPoints/View.xaml
new file mode 100644
index 000000000..d026a25db
--- /dev/null
+++ b/samples/MauiSample/Lines/CustomPoints/View.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
diff --git a/samples/MauiSample/Lines/CustomPoints/View.xaml.cs b/samples/MauiSample/Lines/CustomPoints/View.xaml.cs
new file mode 100644
index 000000000..08e853813
--- /dev/null
+++ b/samples/MauiSample/Lines/CustomPoints/View.xaml.cs
@@ -0,0 +1,10 @@
+namespace MauiSample.Lines.CustomPoints;
+
+[XamlCompilation(XamlCompilationOptions.Compile)]
+public partial class View : ContentPage
+{
+ public View()
+ {
+ InitializeComponent();
+ }
+}
diff --git a/samples/MauiSample/MauiProgram.cs b/samples/MauiSample/MauiProgram.cs
index 77d9f8302..2c17f23ef 100644
--- a/samples/MauiSample/MauiProgram.cs
+++ b/samples/MauiSample/MauiProgram.cs
@@ -8,7 +8,7 @@ public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
_ = builder
- .UseSkiaSharp(true)
+ .UseSkiaSharp()
.UseMauiApp()
.ConfigureFonts(fonts =>
{
diff --git a/samples/MauiSample/Pies/Icons/View.xaml b/samples/MauiSample/Pies/Icons/View.xaml
new file mode 100644
index 000000000..f25a0aab7
--- /dev/null
+++ b/samples/MauiSample/Pies/Icons/View.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/samples/MauiSample/Pies/Icons/View.xaml.cs b/samples/MauiSample/Pies/Icons/View.xaml.cs
new file mode 100644
index 000000000..d680e1315
--- /dev/null
+++ b/samples/MauiSample/Pies/Icons/View.xaml.cs
@@ -0,0 +1,10 @@
+namespace MauiSample.Pies.Icons;
+
+[XamlCompilation(XamlCompilationOptions.Compile)]
+public partial class View : ContentPage
+{
+ public View()
+ {
+ InitializeComponent();
+ }
+}
diff --git a/samples/QuestPDFSample/Program.cs b/samples/QuestPDFSample/Program.cs
index 2a62615fb..3a9ad49c3 100644
--- a/samples/QuestPDFSample/Program.cs
+++ b/samples/QuestPDFSample/Program.cs
@@ -1,6 +1,5 @@
using System.Diagnostics;
using System.Reflection;
-using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.SKCharts;
using QuestPDF.Fluent;
@@ -34,11 +33,10 @@
{
Width = (int)size.Width,
Height = (int)size.Height,
- Series = new ISeries[]
- {
- new LineSeries { Values = new int[] { 1, 5, 4, 6 } },
- new ColumnSeries { Values = new int[] { 4, 8, 2, 4 } }
- }
+ Series = [
+ new LineSeries { Values = [1, 5, 4, 6] },
+ new ColumnSeries { Values = [4, 8, 2, 4] }
+ ]
};
cartesianChart.SaveImage(canvas);
diff --git a/samples/UnoPlatform_v5/Directory.Packages.props b/samples/UnoPlatform_v5/Directory.Packages.props
index a09997cbe..7568d86af 100644
--- a/samples/UnoPlatform_v5/Directory.Packages.props
+++ b/samples/UnoPlatform_v5/Directory.Packages.props
@@ -1,4 +1,4 @@
-
+
@@ -10,8 +10,8 @@
-
-
+
+
diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Lines/CustomPoints/View.xaml b/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Lines/CustomPoints/View.xaml
new file mode 100644
index 000000000..2505b1eab
--- /dev/null
+++ b/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Lines/CustomPoints/View.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Lines/CustomPoints/View.xaml.cs b/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Lines/CustomPoints/View.xaml.cs
new file mode 100644
index 000000000..8aa559a3a
--- /dev/null
+++ b/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Lines/CustomPoints/View.xaml.cs
@@ -0,0 +1,11 @@
+using Microsoft.UI.Xaml.Controls;
+
+namespace UnoWinUISample.Lines.CustomPoints;
+
+public sealed partial class View : UserControl
+{
+ public View()
+ {
+ InitializeComponent();
+ }
+}
diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Pies/Gauge/View.xaml b/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Pies/Gauge/View.xaml
index 7f6eca655..444239570 100644
--- a/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Pies/Gauge/View.xaml
+++ b/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Pies/Gauge/View.xaml
@@ -38,7 +38,7 @@
diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Pies/Icons/View.xaml b/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Pies/Icons/View.xaml
new file mode 100644
index 000000000..06129e283
--- /dev/null
+++ b/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Pies/Icons/View.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
diff --git a/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Pies/Icons/View.xaml.cs b/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Pies/Icons/View.xaml.cs
new file mode 100644
index 000000000..f40206a09
--- /dev/null
+++ b/samples/UnoPlatform_v5/UnoPlatform_v5/LiveChartsSamples/Pies/Icons/View.xaml.cs
@@ -0,0 +1,11 @@
+using Microsoft.UI.Xaml.Controls;
+
+namespace UnoWinUISample.Pies.Icons;
+
+public sealed partial class View : UserControl
+{
+ public View()
+ {
+ InitializeComponent();
+ }
+}
diff --git a/samples/ViewModelsSamples/Axes/ColorsAndPosition/ViewModel.cs b/samples/ViewModelsSamples/Axes/ColorsAndPosition/ViewModel.cs
index 17e0dd40b..644793411 100644
--- a/samples/ViewModelsSamples/Axes/ColorsAndPosition/ViewModel.cs
+++ b/samples/ViewModelsSamples/Axes/ColorsAndPosition/ViewModel.cs
@@ -1,5 +1,4 @@
using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using LiveChartsCore;
using LiveChartsCore.Drawing;
@@ -11,24 +10,22 @@
namespace ViewModelsSamples.Axes.ColorsAndPosition;
-public partial class ViewModel : ObservableObject
+public partial class ViewModel
{
private AxisPosition _selectedPosition = AxisPosition.End;
private int _selectedColor = 0;
private readonly LvcColor[] _colors = ColorPalletes.FluentDesign;
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new ColumnSeries
{
Values = new ObservableCollection { 2, 5, 4, -2, 4, -3, 5 },
Stroke = null,
Fill = new SolidColorPaint { Color = SKColors.DarkOliveGreen }
}
- };
+ ];
- public Axis[] XAxes { get; set; } =
- {
+ public Axis[] XAxes { get; set; } = [
new Axis
{
//Name = "X axis",
@@ -42,10 +39,9 @@ public partial class ViewModel : ObservableObject
Position = AxisPosition.End
}
- };
+ ];
- public Axis[] YAxes { get; set; } =
- {
+ public Axis[] YAxes { get; set; } = [
new Axis
{
//Name = "Y axis",
@@ -54,7 +50,7 @@ public partial class ViewModel : ObservableObject
SeparatorsPaint = new SolidColorPaint { Color = SKColors.LightPink, StrokeThickness = 3 },
Position = AxisPosition.End
}
- };
+ ];
[RelayCommand]
public void SetNewColor()
diff --git a/samples/ViewModelsSamples/Axes/Crosshairs/ViewModel.cs b/samples/ViewModelsSamples/Axes/Crosshairs/ViewModel.cs
index 72da8a684..9d82740b7 100644
--- a/samples/ViewModelsSamples/Axes/Crosshairs/ViewModel.cs
+++ b/samples/ViewModelsSamples/Axes/Crosshairs/ViewModel.cs
@@ -1,44 +1,35 @@
-using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
+using LiveChartsCore.Kernel.Sketches;
namespace ViewModelsSamples.Axes.Crosshairs;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
- new LineSeries
- {
- Values = new ObservableCollection { 200, 558, 458, 249, 457, 339, 587 },
- },
- new LineSeries
- {
- Values = new ObservableCollection { 210, 400, 300, 350, 219, 323, 618 },
- },
- };
+ public ISeries[] Series { get; set; } = [
+ new LineSeries { Values = [200, 558, 458, 249, 457, 339, 587] },
+ new LineSeries { Values = [210, 400, 300, 350, 219, 323, 618] },
+ ];
- public Axis[] XAxes { get; set; } =
- {
+ public ICartesianAxis[] XAxes { get; set; } = [
new Axis
{
CrosshairLabelsBackground = SKColors.DarkOrange.AsLvcColor(),
- CrosshairLabelsPaint = new SolidColorPaint(SKColors.DarkRed, 1),
+ CrosshairLabelsPaint = new SolidColorPaint(SKColors.DarkRed),
CrosshairPaint = new SolidColorPaint(SKColors.DarkOrange, 1),
Labeler = value => value.ToString("N2")
}
- };
- public Axis[] YAxes { get; set; } =
- {
+ ];
+
+ public ICartesianAxis[] YAxes { get; set; } = [
new Axis
{
CrosshairLabelsBackground = SKColors.DarkOrange.AsLvcColor(),
- CrosshairLabelsPaint = new SolidColorPaint(SKColors.DarkRed, 1),
+ CrosshairLabelsPaint = new SolidColorPaint(SKColors.DarkRed),
CrosshairPaint = new SolidColorPaint(SKColors.DarkOrange, 1),
CrosshairSnapEnabled = true // snapping is also supported
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Axes/CustomSeparatorsInterval/ViewModel.cs b/samples/ViewModelsSamples/Axes/CustomSeparatorsInterval/ViewModel.cs
index efc5805f6..16bc0f509 100644
--- a/samples/ViewModelsSamples/Axes/CustomSeparatorsInterval/ViewModel.cs
+++ b/samples/ViewModelsSamples/Axes/CustomSeparatorsInterval/ViewModel.cs
@@ -1,29 +1,27 @@
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
+using LiveChartsCore.Kernel.Sketches;
namespace ViewModelsSamples.Axes.CustomSeparatorsInterval;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
- new LineSeries { Values = new[] { 10, 55, 45, 68, 60, 70, 75, 78 } }
- };
+ public ISeries[] Series { get; set; } = [
+ new LineSeries { Values = [10, 55, 45, 68, 60, 70, 75, 78] }
+ ];
- public Axis[] YAxes { get; set; } =
- {
+ public ICartesianAxis[] YAxes { get; set; } = [
new Axis
{
// We can specify a custom separator collection
// the library will use this separators instead of
// calculating them based on the date of the chart
- CustomSeparators = new double[] { 0, 10, 25, 50, 100 },
+ CustomSeparators = [0, 10, 25, 50, 100],
MinLimit = 0, // forces the axis to start at 0
MaxLimit = 100, // forces the axis to end at 100
SeparatorsPaint = new SolidColorPaint(SKColors.Black.WithAlpha(100))
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Axes/DateTimeScaled/ViewModel.cs b/samples/ViewModelsSamples/Axes/DateTimeScaled/ViewModel.cs
index ea6c4829b..3a4c550f5 100644
--- a/samples/ViewModelsSamples/Axes/DateTimeScaled/ViewModel.cs
+++ b/samples/ViewModelsSamples/Axes/DateTimeScaled/ViewModel.cs
@@ -1,39 +1,35 @@
using System;
-using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore;
using LiveChartsCore.Defaults;
+using LiveChartsCore.Kernel.Sketches;
using LiveChartsCore.SkiaSharpView;
namespace ViewModelsSamples.Axes.DateTimeScaled;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new ColumnSeries
{
- Values = new ObservableCollection
- {
- new DateTimePoint(new DateTime(2021, 1, 1), 3),
- new DateTimePoint(new DateTime(2021, 1, 2), 6),
- new DateTimePoint(new DateTime(2021, 1, 3), 5),
- new DateTimePoint(new DateTime(2021, 1, 4), 3),
- new DateTimePoint(new DateTime(2021, 1, 5), 5),
- new DateTimePoint(new DateTime(2021, 1, 6), 8),
- new DateTimePoint(new DateTime(2021, 1, 7), 6)
- }
+ Values = [
+ new() { DateTime = new(2021, 1, 1), Value = 3 },
+ new() { DateTime = new(2021, 1, 2), Value = 6 },
+ new() { DateTime = new(2021, 1, 3), Value = 5 },
+ new() { DateTime = new(2021, 1, 4), Value = 3 },
+ new() { DateTime = new(2021, 1, 5), Value = 5 },
+ new() { DateTime = new(2021, 1, 6), Value = 8 },
+ new() { DateTime = new(2021, 1, 7), Value = 6 }
+ ]
}
- };
+ ];
// You can use the DateTimeAxis class to define a date time based axis // mark
// The first parameter is the time between each point, in this case 1 day // mark
// you can also use 1 year, 1 month, 1 hour, 1 minute, 1 second, 1 millisecond, etc // mark
- // The second parameter is a function that receives the value and returns the label // mark
- public Axis[] XAxes { get; set; } =
- {
+ // The second parameter is a function that receives a date and returns the label as string // mark
+ public ICartesianAxis[] XAxes { get; set; } = [
new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("MMMM dd"))
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Axes/LabelsFormat/ViewModel.cs b/samples/ViewModelsSamples/Axes/LabelsFormat/ViewModel.cs
index e5a82ccdd..7177fa5ba 100644
--- a/samples/ViewModelsSamples/Axes/LabelsFormat/ViewModel.cs
+++ b/samples/ViewModelsSamples/Axes/LabelsFormat/ViewModel.cs
@@ -1,32 +1,29 @@
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
+using LiveChartsCore.Kernel.Sketches;
namespace ViewModelsSamples.Axes.LabelsFormat;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
- new ColumnSeries { Values = new double[] { 426, 583, 104 } },
- new LineSeries { Values = new double[] { 200, 558, 458 }, Fill = null },
- };
-
- public Axis[] XAxes { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
+ new ColumnSeries { Values = [426, 583, 104] },
+ new LineSeries { Values = [200, 558, 458], Fill = null },
+ ];
+
+ public ICartesianAxis[] XAxes { get; set; } = [
new Axis
{
Name = "Salesman/woman",
// Use the labels property for named or static labels // mark
- Labels = new string[] { "Sergio", "Lando", "Lewis" }, // mark
+ Labels = ["Sergio", "Lando", "Lewis"], // mark
LabelsRotation = 15,
}
- };
+ ];
- public Axis[] YAxes { get; set; } =
- {
+ public ICartesianAxis[] YAxes { get; set; } = [
new Axis
{
Name = "Salome",
@@ -36,11 +33,15 @@ public partial class ViewModel : ObservableObject
{
Color = SKColors.Blue,
FontFamily = "Times New Roman",
- SKFontStyle = new SKFontStyle(SKFontStyleWeight.ExtraBold, SKFontStyleWidth.Normal, SKFontStyleSlant.Italic)
+ SKFontStyle = new SKFontStyle(
+ SKFontStyleWeight.ExtraBold,
+ SKFontStyleWidth.Normal,
+ SKFontStyleSlant.Italic)
},
// Use the Labeler property to give format to the axis values // mark
- // Now the Y axis we will display it as currency
+ // Now the Y axis labels have a currency format.
+
// LiveCharts provides some common formatters
// in this case we are using the currency formatter.
Labeler = Labelers.Currency // mark
@@ -48,9 +49,8 @@ public partial class ViewModel : ObservableObject
// you could also build your own currency formatter
// for example:
// Labeler = (value) => value.ToString("C")
-
- // But the one that LiveCharts provides creates shorter labels when
+ // but the one that LiveCharts provides creates shorter labels when
// the amount is in millions or trillions
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Axes/LabelsFormat2/ViewModel.cs b/samples/ViewModelsSamples/Axes/LabelsFormat2/ViewModel.cs
index 94406400a..4c16c7264 100644
--- a/samples/ViewModelsSamples/Axes/LabelsFormat2/ViewModel.cs
+++ b/samples/ViewModelsSamples/Axes/LabelsFormat2/ViewModel.cs
@@ -1,12 +1,12 @@
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
+using LiveChartsCore.Kernel.Sketches;
namespace ViewModelsSamples.Axes.LabelsFormat2;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
public ViewModel()
{
@@ -17,27 +17,24 @@ public ViewModel()
config.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')));
// You can learn more about extra settings at: // mark
- // https://localhost:7053/docs/{{ platform }}/{{ version }}/Overview.Installation#configure-themes-fonts-or-mappers-optional // mark
+ // https://livecharts.dev/docs/{{ platform }}/{{ version }}/Overview.Installation#configure-themes-fonts-or-mappers-optional // mark
}
- public ISeries[] Series { get; set; } =
- {
- new ColumnSeries { Values = new double[] { 426, 583, 104 } },
- new LineSeries { Values = new double[] { 200, 558, 458 }, Fill = null }
- };
+ public ISeries[] Series { get; set; } = [
+ new ColumnSeries { Values = [426, 583, 104] },
+ new LineSeries { Values = [200, 558, 458], Fill = null }
+ ];
- public Axis[] XAxes { get; set; } =
- {
+ public ICartesianAxis[] XAxes { get; set; } = [
new Axis
{
Name = "Salesman/woman",
- Labels = new string[] { "王", "赵", "张" },
+ Labels = ["王", "赵", "张"],
LabelsPaint = new SolidColorPaint(SKColors.Black)
}
- };
+ ];
- public Axis[] YAxes { get; set; } =
- {
+ public ICartesianAxis[] YAxes { get; set; } = [
new Axis
{
Name = "Sales amount",
@@ -47,8 +44,11 @@ public ViewModel()
{
Color = SKColors.Blue,
FontFamily = "Times New Roman",
- SKFontStyle = new SKFontStyle(SKFontStyleWeight.ExtraBold, SKFontStyleWidth.Normal, SKFontStyleSlant.Italic)
+ SKFontStyle = new SKFontStyle(
+ SKFontStyleWeight.ExtraBold,
+ SKFontStyleWidth.Normal,
+ SKFontStyleSlant.Italic)
},
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Axes/LabelsRotation/ViewModel.cs b/samples/ViewModelsSamples/Axes/LabelsRotation/ViewModel.cs
index b5bc9267f..e868c7a44 100644
--- a/samples/ViewModelsSamples/Axes/LabelsRotation/ViewModel.cs
+++ b/samples/ViewModelsSamples/Axes/LabelsRotation/ViewModel.cs
@@ -1,31 +1,29 @@
using System;
-using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore;
+using LiveChartsCore.Kernel.Sketches;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
using SkiaSharp;
namespace ViewModelsSamples.Axes.LabelsRotation;
-public partial class ViewModel : ObservableObject
+public class ViewModel : ObservableObject
{
private double _sliderValue = 15;
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new LineSeries
{
- Values = new ObservableCollection { 200, 558, 458, 249, 457, 339, 587 },
+ Values = [200, 558, 458, 249, 457, 339, 587 ],
XToolTipLabelFormatter = (point) =>
$"This is {Environment.NewLine}" +
$"A multi-line label {Environment.NewLine}" +
$"With a value of {Environment.NewLine}" + point.Coordinate.PrimaryValue,
}
- };
+ ];
- public Axis[] XAxes { get; set; } =
- {
+ public ICartesianAxis[] XAxes { get; set; } = [
new Axis
{
// Use the Label property to indicate the format of the labels in the axis
@@ -45,10 +43,9 @@ public partial class ViewModel : ObservableObject
SeparatorsPaint = new SolidColorPaint(SKColors.LightGray, 2)
}
- };
+ ];
- public Axis[] YAxes { get; set; } =
- {
+ public ICartesianAxis[] YAxes { get; set; } = [
new Axis
{
LabelsRotation = 15,
@@ -67,7 +64,7 @@ public partial class ViewModel : ObservableObject
SeparatorsPaint = new SolidColorPaint(SKColors.LightGray, 2)
}
- };
+ ];
public double SliderValue
{
diff --git a/samples/ViewModelsSamples/Axes/Logarithmic/LogarithmicPoint.cs b/samples/ViewModelsSamples/Axes/Logarithmic/LogarithmicPoint.cs
index 78439bea4..9e98c887e 100644
--- a/samples/ViewModelsSamples/Axes/Logarithmic/LogarithmicPoint.cs
+++ b/samples/ViewModelsSamples/Axes/Logarithmic/LogarithmicPoint.cs
@@ -1,6 +1,6 @@
namespace ViewModelsSamples.Axes.Logarithmic;
-public class LogarithmicPoint
+public struct LogarithmicPoint
{
public double X { get; set; }
public double Y { get; set; }
diff --git a/samples/ViewModelsSamples/Axes/Logarithmic/ViewModel.cs b/samples/ViewModelsSamples/Axes/Logarithmic/ViewModel.cs
index 5a6c2c3a8..bcdc0d664 100644
--- a/samples/ViewModelsSamples/Axes/Logarithmic/ViewModel.cs
+++ b/samples/ViewModelsSamples/Axes/Logarithmic/ViewModel.cs
@@ -1,27 +1,22 @@
using System;
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
+using LiveChartsCore.Kernel.Sketches;
namespace ViewModelsSamples.Axes.Logarithmic;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
// base 10 log, change the base if you require it.
// or use any custom scale the logic is the same.
private static readonly int s_logBase = 10;
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new LineSeries
{
- // for the x coordinate, we use the X property
- // and for the Y coordinate, we will map it to the logarithm of the value
- Mapping = (logPoint, index) => new(logPoint.X, Math.Log(logPoint.Y, s_logBase)),
- Values = new LogarithmicPoint[]
- {
+ Values = [
new() { X = 1, Y = 1 },
new() { X = 2, Y = 10 },
new() { X = 3, Y = 100 },
@@ -30,12 +25,20 @@ public partial class ViewModel : ObservableObject
new() { X = 6, Y = 100000 },
new() { X = 7, Y = 1000000 },
new() { X = 8, Y = 10000000 }
- }
+ ],
+
+ // lets map the values to the logarithmic scale // mark
+ // for the x coordinate, we use the X property // mark
+ // and for the Y coordinate, we will map it to the logarithm of the Y value // mark
+ Mapping = (logPoint, index) => // mark
+ new(logPoint.X, Math.Log(logPoint.Y, s_logBase)), // mark
+
+ // for more info about mappers see:
+ // https://livecharts.dev/docs/{{ platform }}/{{ version }}/Overview.Mappers
}
- };
+ ];
- public Axis[] YAxes { get; set; } =
- {
+ public ICartesianAxis[] YAxes { get; set; } = [
new LogaritmicAxis(s_logBase)
{
SeparatorsPaint = new SolidColorPaint
@@ -50,5 +53,5 @@ public partial class ViewModel : ObservableObject
},
SubseparatorsCount = 9,
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Axes/Multiple/ViewModel.cs b/samples/ViewModelsSamples/Axes/Multiple/ViewModel.cs
index 423039b0c..d8da30363 100644
--- a/samples/ViewModelsSamples/Axes/Multiple/ViewModel.cs
+++ b/samples/ViewModelsSamples/Axes/Multiple/ViewModel.cs
@@ -1,25 +1,23 @@
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.Kernel.Sketches;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
namespace ViewModelsSamples.Axes.Multiple;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
private static readonly SKColor s_blue = new(25, 118, 210);
private static readonly SKColor s_red = new(229, 57, 53);
private static readonly SKColor s_yellow = new(198, 167, 0);
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new LineSeries
{
LineSmoothness = 1,
Name = "Tens",
- Values = new double[] { 14, 13, 14, 15, 17 },
+ Values = [14, 13, 14, 15, 17],
Stroke = new SolidColorPaint(s_blue, 2),
GeometrySize = 10,
GeometryStroke = new SolidColorPaint(s_blue, 2),
@@ -29,7 +27,7 @@ public partial class ViewModel : ObservableObject
new LineSeries
{
Name = "Tens 2",
- Values = new double[] { 11, 12, 13, 10, 13 },
+ Values = [11, 12, 13, 10, 13],
Stroke = new SolidColorPaint(s_blue, 2),
GeometrySize = 10,
GeometryStroke = new SolidColorPaint(s_blue, 2),
@@ -39,7 +37,7 @@ public partial class ViewModel : ObservableObject
new LineSeries
{
Name = "Hundreds",
- Values = new double[] { 533, 586, 425, 579, 518 },
+ Values = [533, 586, 425, 579, 518],
Stroke = new SolidColorPaint(s_red, 2),
GeometrySize = 10,
GeometryStroke = new SolidColorPaint(s_red, 2),
@@ -49,17 +47,16 @@ public partial class ViewModel : ObservableObject
new LineSeries
{
Name = "Thousands",
- Values = new double[] { 5493, 7843, 4368, 9018, 3902 },
+ Values = [5493, 7843, 4368, 9018, 3902],
Stroke = new SolidColorPaint(s_yellow, 2),
GeometrySize = 10,
GeometryStroke = new SolidColorPaint(s_yellow, 2),
Fill = null,
ScalesYAt = 2 // it will be scaled at the YAxes[2] instance // mark
}
- };
+ ];
- public ICartesianAxis[] YAxes { get; set; } =
- {
+ public ICartesianAxis[] YAxes { get; set; } = [
new Axis // the "units" and "tens" series will be scaled on this axis
{
Name = "Tens",
@@ -103,7 +100,7 @@ public partial class ViewModel : ObservableObject
ShowSeparatorLines = false,
Position = LiveChartsCore.Measure.AxisPosition.End
}
- };
+ ];
public SolidColorPaint LegendTextPaint { get; set; } =
new SolidColorPaint
diff --git a/samples/ViewModelsSamples/Axes/NamedLabels/ViewModel.cs b/samples/ViewModelsSamples/Axes/NamedLabels/ViewModel.cs
index 98111ff66..d51d02359 100644
--- a/samples/ViewModelsSamples/Axes/NamedLabels/ViewModel.cs
+++ b/samples/ViewModelsSamples/Axes/NamedLabels/ViewModel.cs
@@ -1,39 +1,36 @@
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
+using LiveChartsCore.Kernel.Sketches;
namespace ViewModelsSamples.Axes.NamedLabels;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new ColumnSeries
{
Name = "Sales",
- Values = new int[] { 200, 558, 458, 249 },
+ Values = [200, 558, 458, 249],
},
new LineSeries
{
Name = "Projected",
- Values = new int[] { 300, 450, 400, 280 },
+ Values = [300, 450, 400, 280],
Fill = null
}
- };
+ ];
- public Axis[] XAxes { get; set; } =
- {
+ public ICartesianAxis[] XAxes { get; set; } = [
new Axis
{
// Use the labels property to define named labels.
- Labels = new string[] { "Anne", "Johnny", "Zac", "Rosa" }
+ Labels = ["Anne", "Johnny", "Zac", "Rosa"]
}
- };
+ ];
- public Axis[] YAxes { get; set; } =
- {
+ public ICartesianAxis[] YAxes { get; set; } = [
new Axis
{
// Now the Y axis we will display labels as currency
@@ -48,7 +45,7 @@ public partial class ViewModel : ObservableObject
// But the one that LiveCharts provides creates shorter labels when
// the amount is in millions or trillions
}
- };
+ ];
public SolidColorPaint TooltipTextPaint { get; set; } =
new SolidColorPaint
diff --git a/samples/ViewModelsSamples/Axes/Paging/ViewModel.cs b/samples/ViewModelsSamples/Axes/Paging/ViewModel.cs
index b09d2d637..48af49903 100644
--- a/samples/ViewModelsSamples/Axes/Paging/ViewModel.cs
+++ b/samples/ViewModelsSamples/Axes/Paging/ViewModel.cs
@@ -1,16 +1,20 @@
using System;
using System.Collections.Generic;
-using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using LiveChartsCore;
+using LiveChartsCore.Kernel.Sketches;
using LiveChartsCore.SkiaSharpView;
namespace ViewModelsSamples.Axes.Paging;
-public partial class ViewModel : ObservableObject
+public partial class ViewModel
{
private readonly Random _random = new();
+ public ISeries[] Series { get; }
+
+ public ICartesianAxis[] XAxes { get; }
+
public ViewModel()
{
var trend = 100;
@@ -22,21 +26,10 @@ public ViewModel()
values.Add(trend);
}
- Series = new ISeries[]
- {
- new ColumnSeries
- {
- Values = values
- }
- };
-
- XAxes = new[] { new Axis() };
+ Series = [new ColumnSeries(values)];
+ XAxes = [new Axis()];
}
- public ISeries[] Series { get; }
-
- public Axis[] XAxes { get; }
-
[RelayCommand]
public void GoToPage1()
{
diff --git a/samples/ViewModelsSamples/Axes/Shared/ViewModel.cs b/samples/ViewModelsSamples/Axes/Shared/ViewModel.cs
index 7b324f2db..e22634033 100644
--- a/samples/ViewModelsSamples/Axes/Shared/ViewModel.cs
+++ b/samples/ViewModelsSamples/Axes/Shared/ViewModel.cs
@@ -1,42 +1,57 @@
using System;
-using CommunityToolkit.Mvvm.ComponentModel;
+using System.Linq;
using LiveChartsCore;
using LiveChartsCore.Measure;
using LiveChartsCore.SkiaSharpView;
+using LiveChartsCore.SkiaSharpView.Painting;
+using SkiaSharp;
namespace ViewModelsSamples.Axes.Shared;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
+ public ISeries[] SeriesCollection1 { get; set; }
+ public ISeries[] SeriesCollection2 { get; set; }
+ public Axis[] X1 { get; set; }
+ public Axis[] X2 { get; set; }
+ public Margin DrawMargin { get; set; }
+
public ViewModel()
{
- var values1 = new int[50];
- var values2 = new int[50];
- var r = new Random();
- var t = 0;
- var t2 = 0;
-
- for (var i = 0; i < 50; i++)
- {
- t += r.Next(-90, 100);
- values1[i] = t;
-
- t2 += r.Next(-9000, 10000);
- values2[i] = t2;
- }
-
- SeriesCollection1 = new ISeries[] { new LineSeries { Values = values1 } };
- SeriesCollection2 = new ISeries[] { new ColumnSeries { Values = values2 } };
-
- // ideally, when sharing an axis, you should set the initial limits for all the axes involved. // mark
- var start = 0 - 5;
- var end = 50 + 5;
-
- X1 = new Axis[] { new Axis { MinLimit = start, MaxLimit = end } };
- X2 = new Axis[] { new Axis { MinLimit = start, MaxLimit = end } };
-
- X1[0].SharedWith = X2;
- X2[0].SharedWith = X1;
+ var values1 = Fetch();
+ var values2 = Fetch();
+
+ SeriesCollection1 = [new LineSeries { Values = values1 }];
+ SeriesCollection2 = [new ColumnSeries { Values = values2 }];
+
+ // ideally, when sharing an axis, you should set the // mark
+ // initial limits for all the axes involved. // mark
+ var padding = 3;
+ var start = 0 - padding;
+ var end = values1.Length - 1 + padding;
+
+ X1 = [
+ new Axis
+ {
+ MinLimit = start,
+ MaxLimit = end,
+ CrosshairLabelsBackground = SKColors.OrangeRed.AsLvcColor(),
+ CrosshairLabelsPaint = new SolidColorPaint(SKColors.White),
+ CrosshairPaint = new SolidColorPaint(SKColors.OrangeRed.WithAlpha(50), 4),
+ CrosshairPadding = new(8),
+ Labeler = value => value.ToString("N2")
+ }
+ ];
+ X2 = [
+ new Axis
+ {
+ MinLimit = start,
+ MaxLimit = end,
+ CrosshairPaint = new SolidColorPaint(SKColors.OrangeRed.WithAlpha(50), 4)
+ }
+ ];
+
+ SharedAxes.Set(X1[0], X2[0]);
// Force the chart to use 70px margin on the left, this way we can align both charts Y axes. // mark
DrawMargin = new Margin(70, Margin.Auto, Margin.Auto, Margin.Auto);
@@ -59,9 +74,18 @@ public ViewModel()
// calculate the required margin.
}
- public ISeries[] SeriesCollection1 { get; set; }
- public ISeries[] SeriesCollection2 { get; set; }
- public Axis[] X1 { get; set; }
- public Axis[] X2 { get; set; }
- public Margin DrawMargin { get; set; }
+ private static int[] Fetch()
+ {
+ var values = new int[50];
+ var r = new Random();
+ var t = 0;
+
+ for (var i = 0; i < 50; i++)
+ {
+ t += r.Next(-90, 100);
+ values[i] = t;
+ }
+
+ return values;
+ }
}
diff --git a/samples/ViewModelsSamples/Axes/Style/ViewModel.cs b/samples/ViewModelsSamples/Axes/Style/ViewModel.cs
index f798e5933..6a1754ff9 100644
--- a/samples/ViewModelsSamples/Axes/Style/ViewModel.cs
+++ b/samples/ViewModelsSamples/Axes/Style/ViewModel.cs
@@ -1,24 +1,23 @@
using System.Collections.Generic;
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.Defaults;
using LiveChartsCore.Drawing;
+using LiveChartsCore.Kernel.Sketches;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.Painting.Effects;
-using SkiaSharp;
namespace ViewModelsSamples.Axes.Style;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
private static readonly SKColor s_gray = new(195, 195, 195);
private static readonly SKColor s_gray1 = new(160, 160, 160);
private static readonly SKColor s_gray2 = new(90, 90, 90);
private static readonly SKColor s_dark3 = new(60, 60, 60);
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new LineSeries
{
Values = Fetch(),
@@ -26,10 +25,9 @@ public partial class ViewModel : ObservableObject
Fill = null,
GeometrySize = 0
}
- };
+ ];
- public Axis[] XAxes { get; set; } =
- {
+ public ICartesianAxis[] XAxes { get; set; } = [
new Axis
{
Name = "X axis",
@@ -41,7 +39,7 @@ public partial class ViewModel : ObservableObject
{
Color = s_gray,
StrokeThickness = 1,
- PathEffect = new DashEffect(new float[] { 3, 3 })
+ PathEffect = new DashEffect([3, 3])
},
SubseparatorsPaint = new SolidColorPaint
{
@@ -65,10 +63,9 @@ public partial class ViewModel : ObservableObject
StrokeThickness = 1
}
}
- };
+ ];
- public Axis[] YAxes { get; set; } =
- {
+ public ICartesianAxis[] YAxes { get; set; } = [
new Axis
{
Name = "Y axis",
@@ -80,7 +77,7 @@ public partial class ViewModel : ObservableObject
{
Color = s_gray,
StrokeThickness = 1,
- PathEffect = new DashEffect(new float[] { 3, 3 })
+ PathEffect = new DashEffect([3, 3])
},
SubseparatorsPaint = new SolidColorPaint
{
@@ -104,18 +101,18 @@ public partial class ViewModel : ObservableObject
StrokeThickness = 1
}
}
- };
+ ];
public DrawMarginFrame Frame { get; set; } =
- new()
- {
- Fill = new SolidColorPaint(s_dark3),
- Stroke = new SolidColorPaint
+ new()
{
- Color = s_gray,
- StrokeThickness = 1
- }
- };
+ Fill = new SolidColorPaint(s_dark3),
+ Stroke = new SolidColorPaint
+ {
+ Color = s_gray,
+ StrokeThickness = 1
+ }
+ };
private static List Fetch()
{
@@ -125,7 +122,12 @@ private static List Fetch()
for (var x = 0f; x < 1f; x += 0.001f)
{
var y = fx(x);
- list.Add(new ObservablePoint(x - 0.5, y - 0.5));
+
+ list.Add(new()
+ {
+ X = x - 0.5,
+ Y = y - 0.5
+ });
}
return list;
diff --git a/samples/ViewModelsSamples/Axes/TimeSpanScaled/ViewModel.cs b/samples/ViewModelsSamples/Axes/TimeSpanScaled/ViewModel.cs
index 0f6ebae87..e2789d831 100644
--- a/samples/ViewModelsSamples/Axes/TimeSpanScaled/ViewModel.cs
+++ b/samples/ViewModelsSamples/Axes/TimeSpanScaled/ViewModel.cs
@@ -1,28 +1,25 @@
using System;
-using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore;
using LiveChartsCore.Defaults;
+using LiveChartsCore.Kernel.Sketches;
using LiveChartsCore.SkiaSharpView;
namespace ViewModelsSamples.Axes.TimeSpanScaled;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new ColumnSeries
{
- Values = new ObservableCollection
- {
- new TimeSpanPoint(TimeSpan.FromMilliseconds(1), 10),
- new TimeSpanPoint(TimeSpan.FromMilliseconds(2), 6),
- new TimeSpanPoint(TimeSpan.FromMilliseconds(3), 3),
- new TimeSpanPoint(TimeSpan.FromMilliseconds(4), 12),
- new TimeSpanPoint(TimeSpan.FromMilliseconds(5), 8),
- },
+ Values = [
+ new () { TimeSpan = TimeSpan.FromMilliseconds(1), Value = 10 },
+ new () { TimeSpan = TimeSpan.FromMilliseconds(2), Value = 6 },
+ new () { TimeSpan = TimeSpan.FromMilliseconds(3), Value = 3 },
+ new () { TimeSpan = TimeSpan.FromMilliseconds(4), Value = 12 },
+ new () { TimeSpan = TimeSpan.FromMilliseconds(5), Value = 8 }
+ ],
}
- };
+ ];
// You can use the TimeSpanAxis class to define a time span based axis // mark
@@ -30,8 +27,7 @@ public partial class ViewModel : ObservableObject
// you can also use 1 year, 1 month, 1 hour, 1 minute, 1 second, 1 millisecond, etc // mark
// The second parameter is a function that receives the value and returns the label // mark
- public Axis[] XAxes { get; set; } =
- {
+ public ICartesianAxis[] XAxes { get; set; } = [
new TimeSpanAxis(TimeSpan.FromMilliseconds(1), date => date.ToString("fff") + "ms")
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Bars/AutoUpdate/ViewModel.cs b/samples/ViewModelsSamples/Bars/AutoUpdate/ViewModel.cs
index e588efa21..82d563f78 100644
--- a/samples/ViewModelsSamples/Bars/AutoUpdate/ViewModel.cs
+++ b/samples/ViewModelsSamples/Bars/AutoUpdate/ViewModel.cs
@@ -1,7 +1,5 @@
using System;
-using System.Collections.Generic;
using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using LiveChartsCore;
using LiveChartsCore.Defaults;
@@ -9,101 +7,88 @@
namespace ViewModelsSamples.Bars.AutoUpdate;
-public partial class ViewModel : ObservableObject
+public partial class ViewModel
{
- private int _index = 0;
private readonly Random _random = new();
- private readonly ObservableCollection _observableValues;
+
+ // We use the ObservableCollection class, to let the chart know // mark
+ // when a new item is added or removed from the chart. // mark
+ public ObservableCollection Series { get; set; }
+ public ObservableCollection ObservablePoints { get; set; }
public ViewModel()
{
- // Use ObservableCollections to let the chart listen for changes (or any INotifyCollectionChanged). // mark
- _observableValues =
- [
- // Use the ObservableValue or ObservablePoint types to let the chart listen for property changes // mark
- // or use any INotifyPropertyChanged implementation // mark
- new ObservablePoint(_index++, 2),
- new(_index++, 5), // the ObservablePoint type is redundant and inferred by the compiler (C# 9 and above)
- new(_index++, 4),
- new(_index++, 5),
- new(_index++, 2),
- new(_index++, 6),
- new(_index++, 6),
- new(_index++, 6),
- new(_index++, 4),
- new(_index++, 2),
- new(_index++, 3),
- new(_index++, 8),
- new(_index++, 3)
+ ObservablePoints = [
+ new() { X = 0, Y = 2 },
+ new() { X = 1, Y = 5 },
+ new() { X = 2, Y = 4 }
];
- Series =
- [
- new ColumnSeries
- {
- Values = _observableValues
- }
+ Series = [
+ new ColumnSeries(ObservablePoints)
];
-
- // in the following sample notice that the type int does not implement INotifyPropertyChanged
- // and our Series.Values property is of type List
- // List does not implement INotifyCollectionChanged
- // this means the following series is not listening for changes.
- // Series.Add(new ColumnSeries { Values = new List { 2, 4, 6, 1, 7, -2 } }); // mark
}
- public ObservableCollection Series { get; set; }
-
[RelayCommand]
- public void AddItem()
+ public void AddSeries()
{
- // for this sample only 50 items are supported.
- if (_observableValues.Count > 50) return;
+ // Because the Series property is an ObservableCollection, // mark
+ // the chart will listen for changes and update // mark
+ // in this case a new series is added to the chart // mark
- var randomValue = _random.Next(1, 10);
- _observableValues.Add(new ObservablePoint(_index++, randomValue));
+ var newColumnSeries = new ColumnSeries(FetchVales());
+ Series.Add(newColumnSeries);
}
[RelayCommand]
- public void RemoveItem()
+ public void RemoveSeries()
{
- if (_observableValues.Count < 2) return;
+ if (Series.Count == 1) return;
- _observableValues.RemoveAt(0);
+ // This will also remove the series from the UI. // mark
+ Series.RemoveAt(Series.Count - 1);
}
[RelayCommand]
- public void ReplaceItem()
+ public void AddItem()
{
- var randomValue = _random.Next(1, 10);
- var randomIndex = _random.Next(0, _observableValues.Count - 1);
- _observableValues[randomIndex] = new(_observableValues[randomIndex].X, randomValue);
+ var newPoint = new ObservablePoint
+ {
+ X = ObservablePoints.Count,
+ Y = _random.Next(0, 10)
+ };
+
+ // The new point will be drawn at the end of the chart // mark
+ ObservablePoints.Add(newPoint);
}
-
[RelayCommand]
- public void AddSeries()
+ public void RemoveItem()
{
- // for this sample only 5 series are supported.
- if (Series.Count == 5) return;
-
- Series.Add(
- new ColumnSeries
- {
- Values = new List
- {
- _random.Next(0, 10),
- _random.Next(0, 10),
- _random.Next(0, 10)
- }
- });
+ if (ObservablePoints.Count < 2) return;
+
+ // Because the ObservablePoints property is an ObservableCollection, // mark
+ // the chart will listen for changes and update // mark
+ // in this case a point is removed from the chart // mark
+
+ ObservablePoints.RemoveAt(0);
}
[RelayCommand]
- public void RemoveSeries()
+ public void ReplaceItem()
{
- if (Series.Count == 1) return;
+ var randomIndex = _random.Next(0, ObservablePoints.Count - 1);
- Series.RemoveAt(Series.Count - 1);
+ // The chart will update the point at the specified index // mark
+ ObservablePoints[randomIndex] = new(ObservablePoints[randomIndex].X, _random.Next(1, 10));
+ }
+
+ private int[] FetchVales()
+ {
+ return [
+ _random.Next(0, 10),
+ _random.Next(0, 10),
+ _random.Next(0, 10)
+ ];
}
}
diff --git a/samples/ViewModelsSamples/Bars/Basic/ViewModel.cs b/samples/ViewModelsSamples/Bars/Basic/ViewModel.cs
index 693cab2d1..1ebb85a17 100644
--- a/samples/ViewModelsSamples/Bars/Basic/ViewModel.cs
+++ b/samples/ViewModelsSamples/Bars/Basic/ViewModel.cs
@@ -1,32 +1,31 @@
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
namespace ViewModelsSamples.Bars.Basic;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
public ISeries[] Series { get; set; } =
- {
+ [
new ColumnSeries
{
Name = "Mary",
- Values = new double[] { 2, 5, 4 }
+ Values = [2, 5, 4]
},
new ColumnSeries
{
Name = "Ana",
- Values = new double[] { 3, 1, 6 }
+ Values = [3, 1, 6]
}
- };
+ ];
public Axis[] XAxes { get; set; } =
- {
+ [
new Axis
{
- Labels = new string[] { "Category 1", "Category 2", "Category 3" },
+ Labels = ["Category 1", "Category 2", "Category 3"],
LabelsRotation = 0,
SeparatorsPaint = new SolidColorPaint(new SKColor(200, 200, 200)),
SeparatorsAtCenter = false,
@@ -38,5 +37,5 @@ public partial class ViewModel : ObservableObject
ForceStepToMin = true, // mark
MinStep = 1 // mark
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Bars/Custom/ViewModel.cs b/samples/ViewModelsSamples/Bars/Custom/ViewModel.cs
index f7dfbe078..20291e8a2 100644
--- a/samples/ViewModelsSamples/Bars/Custom/ViewModel.cs
+++ b/samples/ViewModelsSamples/Bars/Custom/ViewModel.cs
@@ -1,32 +1,28 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using LiveChartsCore;
+using LiveChartsCore;
using LiveChartsCore.Drawing;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
namespace ViewModelsSamples.Bars.Custom;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
- new ColumnSeries
- {
- Values = new double[] { 2, 1, 4},
- },
+ public ISeries[] Series { get; set; } = [
+ new ColumnSeries ([2, 1, 4]),
+
+ // use the second generic parameter to define the geometry to draw
+ // there are many predefined geometries in the LiveChartsCore.Drawing namespace
+ // for example, the StarGeometry, CrossGeometry, RectangleGeometry and DiamondGeometry
+ new ColumnSeries([4, 3, 6]),
- // You can also use SVG paths to draw the geometry
- // LiveCharts already provides some predefined paths in the SVGPoints class.
- new ColumnSeries
- {
- Values = new double[] { -2, 2, 1 },
- GeometrySvg = SVGPoints.Star
- },
+ // You can also use SVG paths to draw the geometry
+ // the VariableSVGPathGeometry can change the drawn path at runtime
+ new ColumnSeries([-2, 2, 1])
+ {
+ GeometrySvg = SVGPoints.Star
+ },
- // you can declare your own gemetry and use the SkiaSharp api to draw it
- new ColumnSeries
- {
- Values = new double[] { 4, 5, 2 },
- },
- };
+ // finally you can also use SkiaSharp to draw your own geometry
+ new ColumnSeries([4, 5, 2])
+ ];
}
diff --git a/samples/ViewModelsSamples/Bars/DelayedAnimation/ViewModel.cs b/samples/ViewModelsSamples/Bars/DelayedAnimation/ViewModel.cs
index 2fa32acd7..64ed2af70 100644
--- a/samples/ViewModelsSamples/Bars/DelayedAnimation/ViewModel.cs
+++ b/samples/ViewModelsSamples/Bars/DelayedAnimation/ViewModel.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore;
using LiveChartsCore.Drawing;
using LiveChartsCore.Kernel;
@@ -9,33 +8,22 @@
namespace ViewModelsSamples.Bars.DelayedAnimation;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
+ public List Series { get; set; }
+
public ViewModel()
{
- var values1 = new List();
- var values2 = new List();
-
- var fx = EasingFunctions.BounceInOut; // this is the function we are going to plot
- var x = 0f;
-
- while (x <= 1)
- {
- values1.Add(fx(x));
- values2.Add(fx(x - 0.15f));
- x += 0.025f;
- }
-
var columnSeries1 = new ColumnSeries
{
- Values = values1,
+ Values = FetchVales(0),
Stroke = null,
Padding = 2
};
var columnSeries2 = new ColumnSeries
{
- Values = values2,
+ Values = FetchVales(-0.15f),
Stroke = null,
Padding = 2
};
@@ -48,10 +36,15 @@ public ViewModel()
private void OnPointMeasured(ChartPoint point)
{
- var perPointDelay = 100; // milliseconds
+ var perPointDelay = 100; // in milliseconds
var delay = point.Context.Entity.MetaData!.EntityIndex * perPointDelay;
var speed = (float)point.Context.Chart.AnimationsSpeed.TotalMilliseconds + delay;
+ // the animation takes a function, that represents the progress of the animation
+ // the parameter is the progress of the animation, it goes from 0 to 1
+ // the function must return a value from 0 to 1, where 0 is the initial state
+ // and 1 is the end state
+
point.Visual?.SetTransition(
new Animation(progress =>
{
@@ -64,5 +57,22 @@ private void OnPointMeasured(ChartPoint Series { get; set; }
+ private static List FetchVales(float offset)
+ {
+ var values = new List();
+
+ // the EasingFunctions.BounceInOut, is just
+ // a function that takes a double and returns a double
+
+ var fx = EasingFunctions.BounceInOut;
+ var x = 0f;
+
+ while (x <= 1)
+ {
+ values.Add(fx(x + offset));
+ x += 0.025f;
+ }
+
+ return values;
+ }
}
diff --git a/samples/ViewModelsSamples/Bars/Layered/ViewModel.cs b/samples/ViewModelsSamples/Bars/Layered/ViewModel.cs
index db2a238d3..7788a479f 100644
--- a/samples/ViewModelsSamples/Bars/Layered/ViewModel.cs
+++ b/samples/ViewModelsSamples/Bars/Layered/ViewModel.cs
@@ -1,26 +1,24 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using LiveChartsCore;
+using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
namespace ViewModelsSamples.Bars.Layered;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new ColumnSeries
{
- Values = new[] { 6, 3, 5, 7, 3, 4, 6, 3 },
+ Values = [6, 3, 5, 7, 3, 4, 6, 3],
Stroke = null,
MaxBarWidth = double.MaxValue,
IgnoresBarPosition = true
},
new ColumnSeries
{
- Values = new[] { 2, 4, 8, 9, 5, 2, 4, 7 },
+ Values = [2, 4, 8, 9, 5, 2, 4, 7],
Stroke = null,
MaxBarWidth = 30,
IgnoresBarPosition = true
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Bars/Race/ViewModel.cs b/samples/ViewModelsSamples/Bars/Race/ViewModel.cs
index 7e4af6212..7f40cc013 100644
--- a/samples/ViewModelsSamples/Bars/Race/ViewModel.cs
+++ b/samples/ViewModelsSamples/Bars/Race/ViewModel.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
@@ -20,6 +21,7 @@ public PilotInfo(string name, int value, SolidColorPaint paint)
{
Name = name;
Paint = paint;
+
// the ObservableValue.Value property is used by the chart
Value = value;
}
@@ -41,8 +43,8 @@ public ViewModel()
.ToArray();
// generate some data for each pilot:
- _data = new PilotInfo[]
- {
+ _data =
+ [
new("Tsunoda", 500, paints[0]),
new("Sainz", 450, paints[1]),
new("Riccardo", 520, paints[2]),
@@ -50,11 +52,11 @@ public ViewModel()
new("Perez", 660, paints[4]),
new("Verstapen", 920, paints[5]),
new("Hamilton", 1000, paints[6])
- };
+ ];
var rowSeries = new RowSeries
{
- Values = _data.OrderBy(x => x.Value).ToArray(),
+ Values = SortData(),
DataLabelsPaint = new SolidColorPaint(new SKColor(245, 245, 245)),
DataLabelsPosition = DataLabelsPosition.End,
DataLabelsTranslate = new(-1, 0),
@@ -69,7 +71,7 @@ public ViewModel()
point.Visual.Fill = point.Model!.Paint;
});
- _series = new[] { rowSeries };
+ _series = [rowSeries];
_ = StartRace();
}
@@ -78,10 +80,10 @@ public ViewModel()
private ISeries[] _series;
[ObservableProperty]
- private Axis[] _xAxes = { new Axis { SeparatorsPaint = new SolidColorPaint(new SKColor(220, 220, 220)) } };
+ private Axis[] _xAxes = [new Axis { SeparatorsPaint = new SolidColorPaint(new SKColor(220, 220, 220)) }];
[ObservableProperty]
- private Axis[] _yAxes = { new Axis { IsVisible = false } };
+ private Axis[] _yAxes = [new Axis { IsVisible = false }];
public bool IsReading { get; set; } = true;
@@ -98,10 +100,11 @@ public async Task StartRace()
foreach (var item in _data)
item.Value += _r.Next(0, 100);
- Series[0].Values =
- _data.OrderBy(x => x.Value).ToArray();
+ Series[0].Values = SortData();
await Task.Delay(100);
}
}
+
+ private ICollection SortData() => [.. _data.OrderBy(x => x.Value)];
}
diff --git a/samples/ViewModelsSamples/Bars/RowsWithLabels/ViewModel.cs b/samples/ViewModelsSamples/Bars/RowsWithLabels/ViewModel.cs
index 1697e1701..45d3606d8 100644
--- a/samples/ViewModelsSamples/Bars/RowsWithLabels/ViewModel.cs
+++ b/samples/ViewModelsSamples/Bars/RowsWithLabels/ViewModel.cs
@@ -1,20 +1,17 @@
-using System.Collections.Generic;
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.Measure;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
namespace ViewModelsSamples.Bars.RowsWithLabels;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new RowSeries
{
- Values = new List { 8, -3, 4 },
+ Values = [8, -3, 4],
Stroke = null,
DataLabelsPaint = new SolidColorPaint(new SKColor(45, 45, 45)),
DataLabelsSize = 14,
@@ -22,7 +19,7 @@ public partial class ViewModel : ObservableObject
},
new RowSeries
{
- Values = new List { 4, -6, 5 },
+ Values = [4, -6, 5],
Stroke = null,
DataLabelsPaint = new SolidColorPaint(new SKColor(250, 250, 250)),
DataLabelsSize = 14,
@@ -30,11 +27,11 @@ public partial class ViewModel : ObservableObject
},
new RowSeries
{
- Values = new List { 6, -9, 3 },
+ Values = [6, -9, 3],
Stroke = null,
DataLabelsPaint = new SolidColorPaint(new SKColor(45, 45, 45)),
DataLabelsSize = 14,
DataLabelsPosition = DataLabelsPosition.Start
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Bars/Spacing/ViewModel.cs b/samples/ViewModelsSamples/Bars/Spacing/ViewModel.cs
index aceae5dd5..72a2f46db 100644
--- a/samples/ViewModelsSamples/Bars/Spacing/ViewModel.cs
+++ b/samples/ViewModelsSamples/Bars/Spacing/ViewModel.cs
@@ -1,17 +1,14 @@
-using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
-using LiveChartsCore;
+using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
namespace ViewModelsSamples.Bars.Spacing;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new ColumnSeries
{
- Values = new ObservableCollection { 20, 50, 40, 20, 40, 30, 50, 20, 50, 40 },
+ Values = [ 20, 50, 40, 20, 40, 30, 50, 20, 50, 40 ],
// Defines the distance between every bars in the series
Padding = 0,
@@ -19,5 +16,5 @@ public partial class ViewModel : ObservableObject
// Defines the max width a bar can have
MaxBarWidth = double.MaxValue
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Bars/WithBackground/ViewModel.cs b/samples/ViewModelsSamples/Bars/WithBackground/ViewModel.cs
index 5a456c793..fe7d46ffb 100644
--- a/samples/ViewModelsSamples/Bars/WithBackground/ViewModel.cs
+++ b/samples/ViewModelsSamples/Bars/WithBackground/ViewModel.cs
@@ -1,34 +1,32 @@
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
+using LiveChartsCore.Kernel.Sketches;
namespace ViewModelsSamples.Bars.WithBackground;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new ColumnSeries
{
IsHoverable = false, // disables the series from the tooltips // mark
- Values = new double[] { 10, 10, 10, 10, 10, 10, 10 },
+ Values = [10, 10, 10, 10, 10, 10, 10],
Stroke = null,
Fill = new SolidColorPaint(new SKColor(30, 30, 30, 30)),
IgnoresBarPosition = true
},
new ColumnSeries
{
- Values = new double[] { 3, 10, 5, 3, 7, 3, 8 },
+ Values = [3, 10, 5, 3, 7, 3, 8],
Stroke = null,
Fill = new SolidColorPaint(SKColors.CornflowerBlue),
IgnoresBarPosition = true
}
- };
+ ];
- public Axis[] YAxes { get; set; } =
- {
+ public ICartesianAxis[] YAxes { get; set; } = [
new Axis { MinLimit = 0, MaxLimit = 10 }
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Box/Basic/ViewModel.cs b/samples/ViewModelsSamples/Box/Basic/ViewModel.cs
index 4ceff16a2..f7ab12e6d 100644
--- a/samples/ViewModelsSamples/Box/Basic/ViewModel.cs
+++ b/samples/ViewModelsSamples/Box/Basic/ViewModel.cs
@@ -1,59 +1,53 @@
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.Defaults;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
namespace ViewModelsSamples.Box.Basic;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new BoxSeries
{
Name = "Year 2023",
- Values = new BoxValue[]
- {
+ Values = [
// max, upper quartile, median, lower quartile, min
new(100, 80, 60, 20, 70),
new(90, 70, 50, 30, 60),
new(80, 60, 40, 10, 50)
- }
+ ]
},
new BoxSeries
{
Name = "Year 2024",
- Values = new BoxValue[]
- {
+ Values = [
new(90, 70, 50, 30, 60),
new(80, 60, 40, 10, 50),
new(70, 50, 30, 20, 40)
- }
+ ]
},
new BoxSeries
{
Name = "Year 2025",
- Values = new BoxValue[]
- {
+ Values = [
new(80, 60, 40, 10, 50),
new(70, 50, 30, 20, 40),
new(60, 40, 20, 10, 30)
- }
+ ]
}
- };
+ ];
- public Axis[] XAxes { get; set; } =
- {
+ public Axis[] XAxes { get; set; } = [
new Axis
{
- Labels = new string[] { "Apperitizers", "Mains", "Desserts" },
+ Labels = ["Apperitizers", "Mains", "Desserts"],
LabelsRotation = 0,
SeparatorsPaint = new SolidColorPaint(new SKColor(200, 200, 200)),
SeparatorsAtCenter = false,
TicksPaint = new SolidColorPaint(new SKColor(35, 35, 35)),
TicksAtCenter = true
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Design/LinearGradients/ViewModel.cs b/samples/ViewModelsSamples/Design/LinearGradients/ViewModel.cs
index 23f32f9d0..687d039b0 100644
--- a/samples/ViewModelsSamples/Design/LinearGradients/ViewModel.cs
+++ b/samples/ViewModelsSamples/Design/LinearGradients/ViewModel.cs
@@ -1,23 +1,21 @@
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
namespace ViewModelsSamples.Design.LinearGradients;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
// linear gradients are based on SkiaSharp linear gradients
// for more info please see:
// https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/graphics/skiasharp/effects/shaders/linear-gradient
- public ISeries[] Series { get; set; } = new ISeries[]
- {
+ public ISeries[] Series { get; set; } = [
new ColumnSeries
{
Name = "John",
- Values = new []{ 3, 7, 2, 9, 4 },
+ Values = [3, 7, 2, 9, 4],
Stroke = null,
// this is an easy way to set a linear gradient:
@@ -26,7 +24,7 @@ public partial class ViewModel : ObservableObject
// but you can customize the gradient
Fill = new LinearGradientPaint(
// the gradient will use the following colors array
- new [] { new SKColor(255, 140, 148), new SKColor(220, 237, 194) },
+ [new SKColor(255, 140, 148), new SKColor(220, 237, 194)],
// now with the following points we are specifying the orientation of the gradient
// by default the gradient is orientated horizontally
@@ -39,21 +37,29 @@ public partial class ViewModel : ObservableObject
// where 0 is the start of the axis and 1 the end. Then to build our vertical gradient
// we must go from the point:
- // (x0, y0) where x0 could be read as "the middle of the x axis" (0.5) and y0 as "the start of the y axis" (0)
+ // (x0, y0) where x0 could be read as "the middle of the x axis" (0.5) and y0 as
+ // "the start of the y axis" (0)
new SKPoint(0.5f, 0),
// to the point:
- // (x1, y1) where x1 could be read as "the middle of the x axis" (0.5) and y0 as "the end of the y axis" (1)
+ // (x1, y1) where x1 could be read as "the middle of the x axis" (0.5) and y0 as
+ // "the end of the y axis" (1)
new SKPoint(0.5f, 1))
},
new LineSeries
{
Name = "Charles",
- Values = new []{ 4, 2, 8, 5, 3 },
+ Values = [4, 2, 8, 5, 3],
GeometrySize = 22,
- Stroke = new LinearGradientPaint(new[]{ new SKColor(45, 64, 89), new SKColor(255, 212, 96)}) { StrokeThickness = 10 },
- GeometryStroke = new LinearGradientPaint(new[]{ new SKColor(45, 64, 89), new SKColor(255, 212, 96)}) { StrokeThickness = 10 },
+ Stroke = new LinearGradientPaint([new SKColor(45, 64, 89), new SKColor(255, 212, 96)])
+ {
+ StrokeThickness = 10
+ },
+ GeometryStroke = new LinearGradientPaint([new SKColor(45, 64, 89), new SKColor(255, 212, 96)])
+ {
+ StrokeThickness = 10
+ },
Fill = null
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Design/RadialGradients/ViewModel.cs b/samples/ViewModelsSamples/Design/RadialGradients/ViewModel.cs
index 87a8b0d20..4def9d308 100644
--- a/samples/ViewModelsSamples/Design/RadialGradients/ViewModel.cs
+++ b/samples/ViewModelsSamples/Design/RadialGradients/ViewModel.cs
@@ -1,19 +1,17 @@
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
namespace ViewModelsSamples.Design.RadialGradients;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
// radial gradients are based on SkiaSharp circular gradients
// for more info please see:
// https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/graphics/skiasharp/effects/shaders/circular-gradients
- private static readonly SKColor[] s_colors =
- {
+ private static readonly SKColor[] s_colors = [
new SKColor(179, 229, 252),
new SKColor(1, 87, 155)
// ...
@@ -22,14 +20,13 @@ public partial class ViewModel : ObservableObject
// by default all the distance between each color is equal
// use the colorPos parameter in the constructor of the RadialGradientPaint class
// to specify the distance between each color
- };
+ ];
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new PieSeries
{
Name = "Maria",
- Values = new []{ 7 },
+ Values = [7],
Stroke = null,
Fill = new RadialGradientPaint(s_colors),
Pushout = 10,
@@ -38,9 +35,9 @@ public partial class ViewModel : ObservableObject
new PieSeries
{
Name = "Charles",
- Values = new []{ 3 },
+ Values = [3],
Stroke = null,
Fill = new RadialGradientPaint(new SKColor(255, 205, 210), new SKColor(183, 28, 28))
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Design/StrokeDashArray/ViewModel.cs b/samples/ViewModelsSamples/Design/StrokeDashArray/ViewModel.cs
index 9b6bb8250..6f2d3674c 100644
--- a/samples/ViewModelsSamples/Design/StrokeDashArray/ViewModel.cs
+++ b/samples/ViewModelsSamples/Design/StrokeDashArray/ViewModel.cs
@@ -1,5 +1,4 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using LiveChartsCore;
+using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.Painting.Effects;
@@ -7,8 +6,10 @@
namespace ViewModelsSamples.Design.StrokeDashArray;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
+ public ISeries[] Series { get; set; }
+
public ViewModel()
{
// The LiveChartsCore.SkiaSharpView.Painting.EffectsPathEffect abstract class is a wrapper for
@@ -23,11 +24,10 @@ public ViewModel()
var strokeDashArray = new float[] { 3 * strokeThickness, 2 * strokeThickness };
var effect = new DashEffect(strokeDashArray);
- Series = new ISeries[]
- {
+ Series = [
new LineSeries
{
- Values = new [] { 4, 2, 8, 5, 3 },
+ Values = [4, 2, 8, 5, 3],
LineSmoothness = 1,
GeometrySize = 22,
Stroke = new SolidColorPaint
@@ -39,8 +39,6 @@ public ViewModel()
},
Fill = null
}
- };
+ ];
}
-
- public ISeries[] Series { get; set; }
}
diff --git a/samples/ViewModelsSamples/Error/Basic/ViewModel.cs b/samples/ViewModelsSamples/Error/Basic/ViewModel.cs
index e2b6fe679..a79125512 100644
--- a/samples/ViewModelsSamples/Error/Basic/ViewModel.cs
+++ b/samples/ViewModelsSamples/Error/Basic/ViewModel.cs
@@ -1,7 +1,7 @@
using System;
-using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore;
using LiveChartsCore.Defaults;
+using LiveChartsCore.Kernel.Sketches;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using LiveChartsCore.SkiaSharpView.Painting;
@@ -9,8 +9,14 @@
namespace ViewModelsSamples.Error.Basic;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
+ public ISeries[] Series0 { get; set; }
+
+ public ISeries[] Series1 { get; set; }
+
+ public ISeries[] Series2 { get; set; }
+
public ViewModel()
{
// use the ErrorValue type to define the error in Y // mark
@@ -41,8 +47,7 @@ public ViewModel()
new(6, 50, 0.3, 6)
};
- Series0 = new ISeries[]
- {
+ Series0 = [
new ColumnSeries
{
Values = values0,
@@ -55,11 +60,10 @@ public ViewModel()
ErrorPaint = new SolidColorPaint(SKColors.Black),
Padding = 0
}
- };
+ ];
// LineSeries also supports error bars // mark
- Series1 = new ISeries[]
- {
+ Series1 = [
new LineSeries
{
Values = values0,
@@ -67,7 +71,7 @@ public ViewModel()
GeometrySize = 4,
Fill = null
}
- };
+ ];
// You can also use DateTime on the X axis // mark
var now = DateTime.Now;
@@ -86,27 +90,19 @@ public ViewModel()
};
// ScatterSeries also supports error bars // mark
- Series2 = new ISeries[]
- {
+ Series2 = [
new ScatterSeries
{
Values = values2,
ErrorPaint = new SolidColorPaint(SKColors.Black),
GeometrySize = 10
}
- };
+ ];
}
- public ISeries[] Series0 { get; set; }
-
- public ISeries[] Series1 { get; set; }
-
- public ISeries[] Series2 { get; set; }
-
// To get more help about DateTime axes see:
// https://livecharts.dev/docs/{{ platform }}/{{ version }}/samples.axes.dateTimeScaled
- public Axis[] DateTimeAxis { get; set; } =
- {
+ public ICartesianAxis[] DateTimeAxis { get; set; } = [
new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("MMMM dd"))
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Events/AddPointOnClick/ViewModel.cs b/samples/ViewModelsSamples/Events/AddPointOnClick/ViewModel.cs
index 113f596ab..0f76f287d 100644
--- a/samples/ViewModelsSamples/Events/AddPointOnClick/ViewModel.cs
+++ b/samples/ViewModelsSamples/Events/AddPointOnClick/ViewModel.cs
@@ -1,5 +1,4 @@
using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using LiveChartsCore;
using LiveChartsCore.Defaults;
@@ -10,34 +9,39 @@
namespace ViewModelsSamples.Events.AddPointOnClick;
-public partial class ViewModel : ObservableObject
+public partial class ViewModel
{
- public ISeries[] SeriesCollection { get; set; } =
- new ISeries[]
- {
+ public ObservableCollection Points { get; set; }
+
+ public ISeries[] SeriesCollection { get; set; }
+
+ public ViewModel()
+ {
+ Points = [
+ new(0, 5),
+ new(3, 8),
+ new(7, 9)
+ ];
+
+ SeriesCollection = [
new LineSeries
{
- Values = new ObservableCollection
- {
- new(0, 5),
- new(3, 8),
- new(7, 9)
- },
+ Values = Points,
Fill = null,
DataPadding = new LiveChartsCore.Drawing.LvcPoint(5, 5)
}
- };
+ ];
+ }
[RelayCommand]
public void PointerDown(PointerCommandArgs args)
{
var chart = (ICartesianChartView)args.Chart;
- var values = (ObservableCollection)SeriesCollection[0].Values!;
// scales the UI coordinates to the corresponding data in the chart.
var scaledPoint = chart.ScalePixelsToData(args.PointerPosition);
// finally add the new point to the data in our chart.
- values.Add(new ObservablePoint(scaledPoint.X, scaledPoint.Y));
+ Points.Add(new ObservablePoint(scaledPoint.X, scaledPoint.Y));
}
}
diff --git a/samples/ViewModelsSamples/Events/Cartesian/ViewModel.cs b/samples/ViewModelsSamples/Events/Cartesian/ViewModel.cs
index ee7cc462d..c7285fc4c 100644
--- a/samples/ViewModelsSamples/Events/Cartesian/ViewModel.cs
+++ b/samples/ViewModelsSamples/Events/Cartesian/ViewModel.cs
@@ -1,5 +1,4 @@
using System.Diagnostics;
-using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore;
using LiveChartsCore.Kernel;
using LiveChartsCore.Kernel.Sketches;
@@ -11,18 +10,20 @@
namespace ViewModelsSamples.Events.Cartesian;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
+ public ISeries[] Series { get; set; }
+
public ViewModel()
{
- var data = new[]
+ var data = new Fruit[]
{
- new Fruit { Name = "Apple", SalesPerDay = 4, Stock = 6 },
- new Fruit { Name = "Orange", SalesPerDay = 6, Stock = 4 },
- new Fruit { Name = "Pinaple", SalesPerDay = 2, Stock = 2 },
- new Fruit { Name = "Potoato", SalesPerDay = 8, Stock = 4 },
- new Fruit { Name = "Lettuce", SalesPerDay = 3, Stock = 6 },
- new Fruit { Name = "Cherry", SalesPerDay = 4, Stock = 8 }
+ new() { Name = "Apple", SalesPerDay = 4, Stock = 6 },
+ new() { Name = "Orange", SalesPerDay = 6, Stock = 4 },
+ new() { Name = "Pinaple", SalesPerDay = 2, Stock = 2 },
+ new() { Name = "Potoato", SalesPerDay = 8, Stock = 4 },
+ new() { Name = "Lettuce", SalesPerDay = 3, Stock = 6 },
+ new() { Name = "Cherry", SalesPerDay = 4, Stock = 8 }
};
var salesPerDaysSeries = new ColumnSeries
@@ -38,16 +39,14 @@ public ViewModel()
};
// notice that the event signature is different for every series
- // use the IDE intellisense to help you (see more bellow in this article). // mark
+ // use the IDE intellisense to help you (see more bellow in this article). // mark
salesPerDaysSeries.ChartPointPointerDown += OnPointerDown; // mark
salesPerDaysSeries.ChartPointPointerHover += OnPointerHover; // mark
salesPerDaysSeries.ChartPointPointerHoverLost += OnPointerHoverLost; // mark
- Series = new ISeries[] { salesPerDaysSeries };
+ Series = [salesPerDaysSeries];
}
- public ISeries[] Series { get; set; }
-
private void OnPointerDown(IChartView chart, ChartPoint? point)
{
if (point?.Visual is null) return;
diff --git a/samples/ViewModelsSamples/Events/Pie/ViewModel.cs b/samples/ViewModelsSamples/Events/Pie/ViewModel.cs
index af8f51642..36aa70cd7 100644
--- a/samples/ViewModelsSamples/Events/Pie/ViewModel.cs
+++ b/samples/ViewModelsSamples/Events/Pie/ViewModel.cs
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
-using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using LiveChartsCore;
using LiveChartsCore.Kernel;
@@ -11,8 +10,10 @@
namespace ViewModelsSamples.Events.Pie;
-public partial class ViewModel : ObservableObject
+public partial class ViewModel
{
+ public ISeries[] Series { get; set; }
+
public ViewModel()
{
var data = new[]
@@ -25,7 +26,7 @@ public ViewModel()
new City { Name = "Guadalajara", Population = 4 }
};
- // the parameter in the AsLiveChartsSeries() function is optional
+ // the parameter in the AsPieSeries() function is optional
// and is useful to customize each series
// it is a function that takes the city and the series assigned to the city as parameters
var seriesCollection = data.AsPieSeries(
@@ -38,11 +39,9 @@ public ViewModel()
series.DataPointerDown += Series_DataPointerDown;
});
- Series = seriesCollection.ToArray();
+ Series = [.. seriesCollection];
}
- public ISeries[] Series { get; set; }
-
private void Series_DataPointerDown(
IChartView chart,
IEnumerable> points)
diff --git a/samples/ViewModelsSamples/Events/Polar/ViewModel.cs b/samples/ViewModelsSamples/Events/Polar/ViewModel.cs
index 8e7a2a4b3..b89678ab4 100644
--- a/samples/ViewModelsSamples/Events/Polar/ViewModel.cs
+++ b/samples/ViewModelsSamples/Events/Polar/ViewModel.cs
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.Diagnostics;
-using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using LiveChartsCore;
using LiveChartsCore.Kernel;
@@ -8,7 +7,7 @@
namespace ViewModelsSamples.Events.Polar;
-public partial class ViewModel : ObservableObject
+public partial class ViewModel
{
public ViewModel()
{
@@ -31,11 +30,11 @@ public ViewModel()
Mapping = (city, index) => new(index, city.Population)
};
- Series = new ISeries[]
- {
+ Series =
+ [
polarLineSeries,
- new PolarLineSeries { Values = new[] { 6, 7, 2, 9, 6, 2 } },
- };
+ new PolarLineSeries { Values = [6, 7, 2, 9, 6, 2] },
+ ];
}
public ISeries[] Series { get; set; }
diff --git a/samples/ViewModelsSamples/Financial/BasicCandlesticks/ViewModel.cs b/samples/ViewModelsSamples/Financial/BasicCandlesticks/ViewModel.cs
index 6660ab7db..a4da1a562 100644
--- a/samples/ViewModelsSamples/Financial/BasicCandlesticks/ViewModel.cs
+++ b/samples/ViewModelsSamples/Financial/BasicCandlesticks/ViewModel.cs
@@ -1,53 +1,39 @@
using System;
using System.Linq;
-using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore;
using LiveChartsCore.Defaults;
using LiveChartsCore.SkiaSharpView;
namespace ViewModelsSamples.Financial.BasicCandlesticks;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
+ public Axis[] XAxes { get; set; }
+
+ public ISeries[] Series { get; set; }
+
public ViewModel()
{
var data = new FinancialData[]
{
- new(new DateTime(2021, 1, 1), 523, 500, 450, 400),
- new(new DateTime(2021, 1, 2), 500, 450, 425, 400),
- new(new DateTime(2021, 1, 3), 490, 425, 400, 380),
- new(new DateTime(2021, 1, 4), 420, 400, 420, 380),
- new(new DateTime(2021, 1, 5), 520, 420, 490, 400),
- new(new DateTime(2021, 1, 6), 580, 490, 560, 440),
- new(new DateTime(2021, 1, 7), 570, 560, 350, 340),
- new(new DateTime(2021, 1, 8), 380, 350, 380, 330),
- new(new DateTime(2021, 1, 9), 440, 380, 420, 350),
- new(new DateTime(2021, 1, 10), 490, 420, 460, 400),
- new(new DateTime(2021, 1, 11), 520, 460, 510, 460),
- new(new DateTime(2021, 1, 12), 580, 510, 560, 500),
- new(new DateTime(2021, 1, 13), 600, 560, 540, 510),
- new(new DateTime(2021, 1, 14), 580, 540, 520, 500),
- new(new DateTime(2021, 1, 15), 580, 520, 560, 520),
- new(new DateTime(2021, 1, 16), 590, 560, 580, 520),
- new(new DateTime(2021, 1, 17), 650, 580, 630, 550),
- new(new DateTime(2021, 1, 18), 680, 630, 650, 600),
- new(new DateTime(2021, 1, 19), 670, 650, 600, 570),
- new(new DateTime(2021, 1, 20), 640, 600, 610, 560),
- new(new DateTime(2021, 1, 21), 630, 610, 630, 590)
+ new() { Date = new DateTime(2021, 1, 1), High = 523, Open = 500, Close = 450, Low = 400 },
+ new() { Date = new DateTime(2021, 1, 2), High = 500, Open = 450, Close = 425, Low = 400 },
+ new() { Date = new DateTime(2021, 1, 3), High = 490, Open = 425, Close = 400, Low = 380 },
+ new() { Date = new DateTime(2021, 1, 4), High = 420, Open = 400, Close = 420, Low = 380 },
+ new() { Date = new DateTime(2021, 1, 5), High = 520, Open = 420, Close = 490, Low = 400 },
+ new() { Date = new DateTime(2021, 1, 6), High = 580, Open = 490, Close = 560, Low = 440 }
};
- Series = new ISeries[]
- {
+ Series = [
new CandlesticksSeries
{
Values = data
.Select(x => new FinancialPointI(x.High, x.Open, x.Close, x.Low))
.ToArray()
}
- };
+ ];
- XAxes = new[]
- {
+ XAxes = [
new Axis
{
LabelsRotation = 15,
@@ -55,19 +41,15 @@ public ViewModel()
.Select(x => x.Date.ToString("yyyy MMM dd"))
.ToArray()
}
- };
+ ];
}
-
- public Axis[] XAxes { get; set; }
-
- public ISeries[] Series { get; set; }
}
-public class FinancialData(DateTime date, double high, double open, double close, double low)
+public class FinancialData
{
- public DateTime Date { get; set; } = date;
- public double High { get; set; } = high;
- public double Open { get; set; } = open;
- public double Close { get; set; } = close;
- public double Low { get; set; } = low;
+ public DateTime Date { get; set; }
+ public double High { get; set; }
+ public double Open { get; set; }
+ public double Close { get; set; }
+ public double Low { get; set; }
}
diff --git a/samples/ViewModelsSamples/General/Animations/ViewModel.cs b/samples/ViewModelsSamples/General/Animations/ViewModel.cs
index 907547d17..0cde8d5d1 100644
--- a/samples/ViewModelsSamples/General/Animations/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/Animations/ViewModel.cs
@@ -17,10 +17,10 @@ public ViewModel()
}
public ISeries[] Series { get; set; } =
- { new ColumnSeries { Values = new[] { 5, 6, 3, 1, 8, 5, 3, 5, 6, 3, 1 } } };
+ [new ColumnSeries { Values = [5, 6, 3, 1, 8, 5, 3, 5, 6, 3, 1] }];
- public (string, Func)[] AvalaibaleCurves => new (string, Func)[]
- {
+ public (string, Func)[] AvalaibaleCurves =>
+ [
// LiveCharts already contains many common animating curves in the EasingFunctions static class.
("Back in", EasingFunctions.BackIn),
("Back out", EasingFunctions.BackOut),
@@ -63,16 +63,16 @@ public ViewModel()
// and also based on cubic bezier curves that are common in web development
// you can build and play with custom cubic bezier curves at https://cubic-bezier.com/#.17,.67,.83,.67
("custom cubic bezier", EasingFunctions.BuildCubicBezier(0.17f, 0.67f, 0.83f, 0.67f)),
- };
+ ];
- public (string, TimeSpan)[] AvailableSpeeds => new (string, TimeSpan)[]
- {
+ public (string, TimeSpan)[] AvailableSpeeds =>
+ [
("Slowest", TimeSpan.FromMilliseconds(1300)),
("Slow", TimeSpan.FromMilliseconds(800)),
("Medium", TimeSpan.FromMilliseconds(500)),
("Fast", TimeSpan.FromMilliseconds(300)),
("Fastest", TimeSpan.FromMilliseconds(100)),
- };
+ ];
public (string, Func) SelectedCurve
{
diff --git a/samples/ViewModelsSamples/General/ChartToImage/ViewModel.cs b/samples/ViewModelsSamples/General/ChartToImage/ViewModel.cs
index 3773eb2a8..4c2153bcb 100644
--- a/samples/ViewModelsSamples/General/ChartToImage/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/ChartToImage/ViewModel.cs
@@ -1,32 +1,26 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using LiveChartsCore;
+using LiveChartsCore;
using LiveChartsCore.Geo;
using LiveChartsCore.SkiaSharpView;
-using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
namespace ViewModelsSamples.General.ChartToImage;
-public partial class ViewModel : ObservableObject
+public partial class ViewModel
{
- public ISeries[] CatesianSeries { get; set; } =
- {
- new LineSeries { Values = new int[] { 1, 5, 4, 6 } },
- new ColumnSeries { Values = new int[] { 4, 8, 2, 4 } }
- };
+ public ISeries[] CatesianSeries { get; set; } = [
+ new LineSeries { Values = [1, 5, 4, 6] },
+ new ColumnSeries { Values = [4, 8, 2, 4] }
+ ];
- public ISeries[] PieSeries { get; set; } =
- {
- new PieSeries { Values = new int[] { 10, } },
- new PieSeries { Values = new int[] { 6 } },
- new PieSeries { Values = new int[] { 4 } }
- };
+ public ISeries[] PieSeries { get; set; } = [
+ new PieSeries { Values = [10,] },
+ new PieSeries { Values = [6] },
+ new PieSeries { Values = [4] }
+ ];
- public IGeoSeries[] GeoSeries { get; set; } = new HeatLandSeries[]
- {
- new()
+ public IGeoSeries[] GeoSeries { get; set; } = [
+ new HeatLandSeries
{
- Lands = new HeatLand[]
- {
+ Lands = [
new() { Name = "bra", Value = 13 },
new() { Name = "mex", Value = 10 },
new() { Name = "usa", Value = 15 },
@@ -41,7 +35,7 @@ public partial class ViewModel : ObservableObject
new() { Name = "kor", Value = 10 },
new() { Name = "zaf", Value = 12 },
new() { Name = "are", Value = 13 }
- }
+ ]
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/General/ConditionalDraw/ViewModel.cs b/samples/ViewModelsSamples/General/ConditionalDraw/ViewModel.cs
index b8cd03d99..4abc25dc5 100644
--- a/samples/ViewModelsSamples/General/ConditionalDraw/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/ConditionalDraw/ViewModel.cs
@@ -1,17 +1,17 @@
using System;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.ConditionalDraw;
using LiveChartsCore.Defaults;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
+using LiveChartsCore.Kernel.Sketches;
namespace ViewModelsSamples.General.ConditionalDraw;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
private readonly ObservableCollection _values = [];
@@ -19,9 +19,10 @@ public ViewModel()
{
var dangerPaint = new SolidColorPaint(SKColors.Red);
- _values =
- [
- new(2), new(5), new(4), new(6), new(8), new(3), new(2), new(4), new(6)
+ _values = [
+ new(2),
+ new(8),
+ new(4)
];
var series = new ColumnSeries
@@ -40,15 +41,14 @@ public ViewModel()
: null; // when null, the series fill is used // mark
});
- Series = new ISeries[] { series };
+ Series = [series];
Randomize();
}
public ISeries[] Series { get; set; }
- public RectangularSection[] Sections { get; set; } =
- {
+ public RectangularSection[] Sections { get; set; } = [
new RectangularSection
{
Label = "Danger zone!",
@@ -60,12 +60,11 @@ public ViewModel()
Yj = 5,
Fill = new SolidColorPaint(SKColors.Red.WithAlpha(50))
}
- };
+ ];
- public Axis[] Y { get; set; } =
- {
+ public ICartesianAxis[] Y { get; set; } = [
new Axis { MinLimit = 0 }
- };
+ ];
private async void Randomize()
{
diff --git a/samples/ViewModelsSamples/General/MapPoints/ViewModel.cs b/samples/ViewModelsSamples/General/MapPoints/ViewModel.cs
index b1b00dd9e..b433b4cc0 100644
--- a/samples/ViewModelsSamples/General/MapPoints/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/MapPoints/ViewModel.cs
@@ -1,15 +1,16 @@
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.ConditionalDraw;
using LiveChartsCore.Measure;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
namespace ViewModelsSamples.General.MapPoints;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
+ public ISeries[] Series { get; set; }
+
public ViewModel()
{
var paints = new SolidColorPaint[]
@@ -22,7 +23,7 @@ public ViewModel()
var series = new ColumnSeries
{
- Values = new[] { 2, 5, 4, 6, 8, 3, 2, 4, 6 },
+ Values = [2, 5, 4, 6, 8, 3, 2, 4, 6],
DataLabelsPaint = new SolidColorPaint(new SKColor(30, 30, 30)),
DataLabelsPosition = DataLabelsPosition.Top
}
@@ -39,8 +40,6 @@ public ViewModel()
point.Visual.Fill = paint;
});
- Series = new ISeries[] { series };
+ Series = [series];
}
-
- public ISeries[] Series { get; set; }
}
diff --git a/samples/ViewModelsSamples/General/MultiThreading/ViewModel.cs b/samples/ViewModelsSamples/General/MultiThreading/ViewModel.cs
index 21332b817..624d14024 100644
--- a/samples/ViewModelsSamples/General/MultiThreading/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/MultiThreading/ViewModel.cs
@@ -3,7 +3,6 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
-using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
@@ -11,13 +10,19 @@
namespace ViewModelsSamples.General.MultiThreading;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
private readonly Random _r = new();
private readonly int _delay = 100;
private readonly ObservableCollection _values;
private int _current;
+ public ISeries[] Series { get; set; }
+
+ public object Sync { get; } = new object();
+
+ public bool IsReading { get; set; } = true;
+
public ViewModel()
{
// lets create some initial data. // mark
@@ -31,8 +36,7 @@ public ViewModel()
_values = new ObservableCollection(items);
// create a series with the data // mark
- Series = new ISeries[]
- {
+ Series = [
new LineSeries
{
Values = _values,
@@ -41,7 +45,7 @@ public ViewModel()
LineSmoothness = 0,
Stroke = new SolidColorPaint(SKColors.Blue, 1)
}
- };
+ ];
_delay = 1;
var readTasks = 10;
@@ -55,12 +59,6 @@ public ViewModel()
}
}
- public ISeries[] Series { get; set; }
-
- public object Sync { get; } = new object();
-
- public bool IsReading { get; set; } = true;
-
private async Task ReadData()
{
await Task.Delay(1000);
diff --git a/samples/ViewModelsSamples/General/MultiThreading2/ViewModel.cs b/samples/ViewModelsSamples/General/MultiThreading2/ViewModel.cs
index cc4bf39a7..3861c2459 100644
--- a/samples/ViewModelsSamples/General/MultiThreading2/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/MultiThreading2/ViewModel.cs
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
-using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
@@ -10,15 +9,19 @@
namespace ViewModelsSamples.General.MultiThreading2;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
private readonly Random _r = new();
private readonly int _delay = 100;
private readonly ObservableCollection _values;
private static int s_current;
- private readonly Action _uiThreadInvoker;
+ private readonly Action _dispatcherService;
- public ViewModel(Action uiThreadInvoker)
+ public ISeries[] Series { get; set; }
+
+ public bool IsReading { get; set; } = true;
+
+ public ViewModel(Action dispatcherService)
{
// lets create some initial data. // mark
var items = new List();
@@ -31,8 +34,7 @@ public ViewModel(Action uiThreadInvoker)
_values = new ObservableCollection(items);
// create a series with the data // mark
- Series = new ISeries[]
- {
+ Series = [
new LineSeries
{
Values = _values,
@@ -41,11 +43,11 @@ public ViewModel(Action uiThreadInvoker)
LineSmoothness = 0,
Stroke = new SolidColorPaint(SKColors.Blue, 1)
}
- };
+ ];
// There are simplier ways to do this, but since we are using a MVVM pattern, // mark
- // we need to inject a delegate that will run an action in the UI thread. // mark
- _uiThreadInvoker = uiThreadInvoker;
+ // we need to inject a delegate that will run an action on the UI thread. // mark
+ _dispatcherService = dispatcherService;
_delay = 1;
var readTasks = 10;
@@ -58,10 +60,6 @@ public ViewModel(Action uiThreadInvoker)
}
}
- public ISeries[] Series { get; set; }
-
- public bool IsReading { get; set; } = true;
-
public async Task ReadData()
{
await Task.Delay(1000);
@@ -74,7 +72,7 @@ public async Task ReadData()
await Task.Delay(_delay);
// force the change to happen in the UI thread. // mark
- _uiThreadInvoker(() =>
+ _dispatcherService(() =>
{
s_current += _r.Next(-9, 10);
_values.Add(s_current);
diff --git a/samples/ViewModelsSamples/General/NullPoints/ViewModel.cs b/samples/ViewModelsSamples/General/NullPoints/ViewModel.cs
index fc146b10b..dfaf296ab 100644
--- a/samples/ViewModelsSamples/General/NullPoints/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/NullPoints/ViewModel.cs
@@ -1,35 +1,30 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using LiveChartsCore;
+using LiveChartsCore;
using LiveChartsCore.Defaults;
using LiveChartsCore.SkiaSharpView;
namespace ViewModelsSamples.General.NullPoints;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } = new ISeries[]
- {
+ public ISeries[] Series { get; set; } = [
new ColumnSeries
{
- Values = new double?[] { 5, 4, null, 3, 2, 6, 5, 6, 2 }
+ Values = [5, 4, null, 3, 2, 6, 5, 6, 2]
},
-
new LineSeries
{
- Values = new double?[] { 2, 6, 5, 3, null, 5, 2, 4, null }
+ Values = [2, 6, 5, 3, null, 5, 2, 4, null]
},
-
new LineSeries
{
- Values = new ObservablePoint?[]
- {
+ Values = [
new ObservablePoint { X = 0, Y = 1 },
new ObservablePoint { X = 1, Y = 4 },
null,
new ObservablePoint { X = 4, Y = 5 },
new ObservablePoint { X = 6, Y = 1 },
new ObservablePoint { X = 8, Y = 6 },
- }
+ ]
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/General/RealTime/ViewModel.cs b/samples/ViewModelsSamples/General/RealTime/ViewModel.cs
index 3f411faf4..6939a6464 100644
--- a/samples/ViewModelsSamples/General/RealTime/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/RealTime/ViewModel.cs
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
-using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore;
using LiveChartsCore.Defaults;
using LiveChartsCore.SkiaSharpView;
@@ -11,16 +10,23 @@
namespace ViewModelsSamples.General.RealTime;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
private readonly Random _random = new();
private readonly List _values = [];
private readonly DateTimeAxis _customAxis;
+ public ObservableCollection Series { get; set; }
+
+ public Axis[] XAxes { get; set; }
+
+ public object Sync { get; } = new object();
+
+ public bool IsReading { get; set; } = true;
+
public ViewModel()
{
- Series =
- [
+ Series = [
new LineSeries
{
Values = _values,
@@ -37,19 +43,11 @@ public ViewModel()
SeparatorsPaint = new SolidColorPaint(SKColors.Black.WithAlpha(100))
};
- XAxes = new Axis[] { _customAxis };
+ XAxes = [_customAxis];
_ = ReadData();
}
- public ObservableCollection Series { get; set; }
-
- public Axis[] XAxes { get; set; }
-
- public object Sync { get; } = new object();
-
- public bool IsReading { get; set; } = true;
-
private async Task ReadData()
{
// to keep this sample simple, we run the next infinite loop // mark
@@ -61,7 +59,7 @@ private async Task ReadData()
// Because we are updating the chart from a different thread // mark
// we need to use a lock to access the chart data. // mark
- // this is not necessary if your changes are made in the UI thread. // mark
+ // this is not necessary if your changes are made on the UI thread. // mark
lock (Sync)
{
_values.Add(new DateTimePoint(DateTime.Now, _random.Next(0, 10)));
@@ -73,19 +71,19 @@ private async Task ReadData()
}
}
- private double[] GetSeparators()
+ private static double[] GetSeparators()
{
var now = DateTime.Now;
- return new double[]
- {
+ return
+ [
now.AddSeconds(-25).Ticks,
now.AddSeconds(-20).Ticks,
now.AddSeconds(-15).Ticks,
now.AddSeconds(-10).Ticks,
now.AddSeconds(-5).Ticks,
now.Ticks
- };
+ ];
}
private static string Formatter(DateTime date)
diff --git a/samples/ViewModelsSamples/General/Scrollable/ViewModel.cs b/samples/ViewModelsSamples/General/Scrollable/ViewModel.cs
index e48552f83..140f12111 100644
--- a/samples/ViewModelsSamples/General/Scrollable/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/Scrollable/ViewModel.cs
@@ -18,18 +18,23 @@ public partial class ViewModel
private bool _isDown = false;
private readonly ObservableCollection _values = [];
+ public ISeries[] Series { get; set; }
+ public Axis[] ScrollableAxes { get; set; }
+ public ISeries[] ScrollbarSeries { get; set; }
+ public Axis[] InvisibleX { get; set; }
+ public Axis[] InvisibleY { get; set; }
+ public LiveChartsCore.Measure.Margin Margin { get; set; }
+ public RectangularSection[] Thumbs { get; set; }
+
public ViewModel()
{
var trend = 1000;
var r = new Random();
for (var i = 0; i < 500; i++)
- {
_values.Add(new ObservablePoint(i, trend += r.Next(-20, 20)));
- }
- Series = new ISeries[]
- {
+ Series = [
new LineSeries
{
Values = _values,
@@ -37,10 +42,9 @@ public ViewModel()
GeometryFill = null,
DataPadding = new(0, 1)
}
- };
+ ];
- ScrollbarSeries = new ISeries[]
- {
+ ScrollbarSeries = [
new LineSeries
{
Values = _values,
@@ -48,20 +52,19 @@ public ViewModel()
GeometryFill = null,
DataPadding = new(0, 1)
}
- };
+ ];
- ScrollableAxes = new[] { new Axis() };
+ ScrollableAxes = [new Axis()];
- Thumbs = new[]
- {
+ Thumbs = [
new RectangularSection
{
Fill = new SolidColorPaint(new SKColor(255, 205, 210, 100))
}
- };
+ ];
- InvisibleX = new[] { new Axis { IsVisible = false } };
- InvisibleY = new[] { new Axis { IsVisible = false } };
+ InvisibleX = [new Axis { IsVisible = false }];
+ InvisibleY = [new Axis { IsVisible = false }];
// force the left margin to be 100 and the right margin 50 in both charts, this will
// align the start and end point of the "draw margin",
@@ -70,14 +73,6 @@ public ViewModel()
Margin = new(100, auto, 50, auto);
}
- public ISeries[] Series { get; set; }
- public Axis[] ScrollableAxes { get; set; }
- public ISeries[] ScrollbarSeries { get; set; }
- public Axis[] InvisibleX { get; set; }
- public Axis[] InvisibleY { get; set; }
- public LiveChartsCore.Measure.Margin Margin { get; set; }
- public RectangularSection[] Thumbs { get; set; }
-
[RelayCommand]
public void ChartUpdated(ChartCommandArgs args)
{
diff --git a/samples/ViewModelsSamples/General/Sections/ViewModel.cs b/samples/ViewModelsSamples/General/Sections/ViewModel.cs
index 74d1082da..00711a8b6 100644
--- a/samples/ViewModelsSamples/General/Sections/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/Sections/ViewModel.cs
@@ -1,17 +1,16 @@
using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.Input;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.Defaults;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
-using SkiaSharp;
namespace ViewModelsSamples.General.Sections;
public partial class ViewModel
{
- public RectangularSection[] Sections { get; set; } =
- {
+ public RectangularSection[] Sections { get; set; } = [
new RectangularSection
{
// creates a section from 3 to 4 in the X axis
@@ -40,10 +39,9 @@ public partial class ViewModel
LabelSize = 14,
LabelPaint = new SolidColorPaint(new SKColor(255, 111, 0))
}
- };
+ ];
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new ScatterSeries
{
Values = new ObservableCollection
@@ -52,31 +50,13 @@ public partial class ViewModel
new(4.5, 2.5),
new(4.2, 7.4),
new(6.4, 9.9),
- new(4.2, 9.2),
- new(5.8, 3.5),
- new(7.3, 5.8),
new(8.9, 3.9),
- new(6.1, 4.6),
- new(9.4, 7.7),
- new(8.4, 8.5),
- new(3.6, 9.6),
- new(4.4, 6.3),
- new(5.8, 4.8),
- new(6.9, 3.4),
- new(7.6, 1.8),
- new(8.3, 8.3),
- new(9.9, 5.2),
- new(8.1, 4.7),
- new(7.4, 3.9),
- new(6.8, 2.3),
- new(5.3, 7.1),
+ new(9.9, 5.2)
}
}
- };
+ ];
[RelayCommand]
- public void ToggleFirst()
- {
+ public void ToggleFirst() =>
Sections[0].IsVisible = !Sections[0].IsVisible;
- }
}
diff --git a/samples/ViewModelsSamples/General/Sections2/ViewModel.cs b/samples/ViewModelsSamples/General/Sections2/ViewModel.cs
index 2a7850d90..1a9d8845c 100644
--- a/samples/ViewModelsSamples/General/Sections2/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/Sections2/ViewModel.cs
@@ -1,17 +1,15 @@
-using CommunityToolkit.Mvvm.ComponentModel;
+using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.Defaults;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
using LiveChartsCore.SkiaSharpView.Painting.Effects;
-using SkiaSharp;
namespace ViewModelsSamples.General.Sections2;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public RectangularSection[] Sections { get; set; } =
- {
+ public RectangularSection[] Sections { get; set; } = [
new RectangularSection
{
Yi = 8,
@@ -20,7 +18,7 @@ public partial class ViewModel : ObservableObject
{
Color = SKColors.Red,
StrokeThickness = 3,
- PathEffect = new DashEffect(new float[] { 6, 6 })
+ PathEffect = new DashEffect([6, 6])
}
},
new RectangularSection
@@ -29,17 +27,16 @@ public partial class ViewModel : ObservableObject
Xj = 6,
Fill = new SolidColorPaint { Color = SKColors.Blue.WithAlpha(20) }
},
- };
+ ];
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new ScatterSeries
{
GeometrySize = 10,
Stroke = new SolidColorPaint { Color = SKColors.Blue, StrokeThickness = 1 },
Fill = null,
- Values = new ObservablePoint[]
- {
+ Values =
+ [
new(2.2, 5.4), new(4.5, 2.5), new(4.2, 7.4),
new(6.4, 9.9), new(4.2, 9.2), new(5.8, 3.5),
new(7.3, 5.8), new(8.9, 3.9), new(6.1, 4.6),
@@ -47,7 +44,7 @@ public partial class ViewModel : ObservableObject
new(4.4, 6.3), new(5.8, 4.8), new(6.9, 3.4),
new(7.6, 1.8), new(8.3, 8.3), new(9.9, 5.2),
new(8.1, 4.7), new(7.4, 3.9), new(6.8, 2.3)
- }
+ ]
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/General/TemplatedLegends/CustomLegend.cs b/samples/ViewModelsSamples/General/TemplatedLegends/CustomLegend.cs
index 498eaeb27..48d177ad0 100644
--- a/samples/ViewModelsSamples/General/TemplatedLegends/CustomLegend.cs
+++ b/samples/ViewModelsSamples/General/TemplatedLegends/CustomLegend.cs
@@ -70,6 +70,7 @@ public LvcSize Measure(Chart chart)
ZIndex = s_zIndex + 1
}
},
+ // series.GetMiniature(null, s_zIndex), or get the miniature defined in the series.
new LabelVisual
{
Text = series.Name ?? string.Empty,
diff --git a/samples/ViewModelsSamples/General/TemplatedLegends/ViewModel.cs b/samples/ViewModelsSamples/General/TemplatedLegends/ViewModel.cs
index d6488cad0..bee51fa55 100644
--- a/samples/ViewModelsSamples/General/TemplatedLegends/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/TemplatedLegends/ViewModel.cs
@@ -1,18 +1,15 @@
-using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
-using LiveChartsCore;
+using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
namespace ViewModelsSamples.General.TemplatedLegends;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new ColumnSeries
{
Name = "Roger",
- Values = new ObservableCollection { 2, 1, 3, 5, 3, 4, 6 }
+ Values = [2, 1, 3, 5, 3, 4, 6]
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/General/TemplatedTooltips/CustomTooltip.cs b/samples/ViewModelsSamples/General/TemplatedTooltips/CustomTooltip.cs
index fb499d8f6..7d98449fb 100644
--- a/samples/ViewModelsSamples/General/TemplatedTooltips/CustomTooltip.cs
+++ b/samples/ViewModelsSamples/General/TemplatedTooltips/CustomTooltip.cs
@@ -50,8 +50,7 @@ public void Show(IEnumerable foundPoints, Chart)point.Context.Series).GetMiniaturesSketch();
- var relativePanel = sketch.AsDrawnControl(s_zIndex);
+ var skiaSeries = (IChartSeries)point.Context.Series;
var label = new LabelVisual
{
@@ -71,12 +70,12 @@ public void Show(IEnumerable foundPoints, Chart
{
- Values = new ObservableCollection { 3, 7, 3, 1, 4, 5, 6 },
+ Values = [3, 7, 3, 1, 4, 5, 6 ],
},
new LineSeries
{
- Values = new ObservableCollection { 2, 1, 3, 5, 3, 4, 6 },
+ Values = [2, 1, 3, 5, 3, 4, 6 ],
Fill = null
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/General/UserDefinedTypes/ViewModel.cs b/samples/ViewModelsSamples/General/UserDefinedTypes/ViewModel.cs
index 895c39849..aa791cf21 100644
--- a/samples/ViewModelsSamples/General/UserDefinedTypes/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/UserDefinedTypes/ViewModel.cs
@@ -1,28 +1,25 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using LiveChartsCore;
+using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
namespace ViewModelsSamples.General.UserDefinedTypes;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new LineSeries
{
Name = "Population",
// use the Population property as the Y coordinate
// and the index of the city in our collection as the X coordinate
Mapping = (city, index) => new(index, city.Population),
- Values = new[]
- {
+ Values = [
new City { Name = "Tokyo", Population = 4 },
new City { Name = "New York", Population = 6 },
new City { Name = "Seoul", Population = 2 },
new City { Name = "Moscow", Population = 8 },
new City { Name = "Shanghai", Population = 3 },
new City { Name = "Guadalajara", Population = 4 }
- }
+ ]
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/General/Visibility/ViewModel.cs b/samples/ViewModelsSamples/General/Visibility/ViewModel.cs
index a33b3e053..b3816f774 100644
--- a/samples/ViewModelsSamples/General/Visibility/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/Visibility/ViewModel.cs
@@ -1,47 +1,38 @@
-using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
+using CommunityToolkit.Mvvm.Input;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
namespace ViewModelsSamples.General.Visibility;
-public partial class ViewModel : ObservableObject
+public partial class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new ColumnSeries
{
- Values = new ObservableCollection { 2, 5, 4, 3 },
+ Values = [2, 5, 4, 3],
IsVisible = true
},
new ColumnSeries
{
- Values = new ObservableCollection { 6, 3, 2, 8 },
+ Values = [6, 3, 2, 8],
IsVisible = true
},
new ColumnSeries
{
- Values = new ObservableCollection { 4, 2, 8, 7 },
+ Values = [4, 2, 8, 7],
IsVisible = true
}
- };
+ ];
[RelayCommand]
- public void ToggleSeries0()
- {
+ public void ToggleSeries0() =>
Series[0].IsVisible = !Series[0].IsVisible;
- }
[RelayCommand]
- public void ToggleSeries1()
- {
+ public void ToggleSeries1() =>
Series[1].IsVisible = !Series[1].IsVisible;
- }
[RelayCommand]
- public void ToggleSeries2()
- {
+ public void ToggleSeries2() =>
Series[2].IsVisible = !Series[2].IsVisible;
- }
}
diff --git a/samples/ViewModelsSamples/General/VisualElements/ViewModel.cs b/samples/ViewModelsSamples/General/VisualElements/ViewModel.cs
index fb31cf7cb..a22ec7531 100644
--- a/samples/ViewModelsSamples/General/VisualElements/ViewModel.cs
+++ b/samples/ViewModelsSamples/General/VisualElements/ViewModel.cs
@@ -1,5 +1,4 @@
using System.Collections.Generic;
-using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore;
using LiveChartsCore.Drawing;
using LiveChartsCore.Kernel;
@@ -15,8 +14,12 @@
namespace ViewModelsSamples.General.VisualElements;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
+ public IEnumerable> VisualElements { get; set; }
+
+ public ISeries[] Series { get; set; }
+
public ViewModel()
{
var visuals = new List>();
@@ -72,20 +75,15 @@ public ViewModel()
visuals.Add(svgVisiual);
VisualElements = visuals;
- Series = new ISeries[]
- {
+ Series = [
new LineSeries
{
GeometrySize = 13,
- Values = new int[] { 2, 2, 3, 4, 2, 2, 3, 6, 3, 5, 2, 1, 4, 5, 2, 3, 2, 4, 5, 3, 2, 6 }
+ Values = [2, 2, 3, 4, 2, 2, 3, 6, 3, 5, 2, 1, 4, 5, 2, 3, 2, 4, 5, 3, 2, 6]
}
- };
+ ];
}
- public IEnumerable> VisualElements { get; set; }
-
- public ISeries[] Series { get; set; }
-
private void RectanglePointerDown(
VisualElement visual,
VisualElementEventArgs visualElementsArgs)
diff --git a/samples/ViewModelsSamples/Heat/Basic/ViewModel.cs b/samples/ViewModelsSamples/Heat/Basic/ViewModel.cs
index e61fcc7aa..b70e88cdf 100644
--- a/samples/ViewModelsSamples/Heat/Basic/ViewModel.cs
+++ b/samples/ViewModelsSamples/Heat/Basic/ViewModel.cs
@@ -1,26 +1,22 @@
-using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
-using LiveChartsCore;
+using LiveChartsCore;
using LiveChartsCore.Defaults;
+using LiveChartsCore.Kernel.Sketches;
using LiveChartsCore.SkiaSharpView;
using SkiaSharp;
namespace ViewModelsSamples.Heat.Basic;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new HeatSeries
{
- HeatMap = new[]
- {
+ HeatMap = [
new SKColor(255, 241, 118).AsLvcColor(), // the first element is the "coldest"
SKColors.DarkSlateGray.AsLvcColor(),
SKColors.Blue.AsLvcColor() // the last element is the "hottest"
- },
- Values = new ObservableCollection
- {
+ ],
+ Values = [
// Charles
new(0, 0, 150), // Jan
new(0, 1, 123), // Feb
@@ -52,23 +48,21 @@ public partial class ViewModel : ObservableObject
new(3, 3, 123), // Apr
new(3, 4, 432), // May
new(3, 5, 142), // Jun
- },
+ ]
}
- };
+ ];
- public Axis[] XAxes { get; set; } =
- {
+ public ICartesianAxis[] XAxes { get; set; } = [
new Axis
{
- Labels = new[] { "Charles", "Richard", "Ana", "Mari" }
+ Labels = ["Charles", "Richard", "Ana", "Mari"]
}
- };
+ ];
- public Axis[] YAxes { get; set; } =
- {
+ public ICartesianAxis[] YAxes { get; set; } = [
new Axis
{
- Labels = new[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun" }
+ Labels = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Index.cs b/samples/ViewModelsSamples/Index.cs
index a969557ee..6246438a9 100644
--- a/samples/ViewModelsSamples/Index.cs
+++ b/samples/ViewModelsSamples/Index.cs
@@ -3,7 +3,7 @@
public static class Index
{
public static string[] Samples =
- {
+ [
"Design/LinearGradients",
"Design/RadialGradients",
@@ -13,20 +13,11 @@ public static class Index
"Lines/Properties",
"Lines/Area",
"Lines/Custom",
+ "Lines/CustomPoints",
"Lines/Padding",
"Lines/XY",
"Lines/Zoom",
- "StepLines/Basic",
- "StepLines/AutoUpdate",
- "StepLines/Properties",
- "StepLines/Area",
- "StepLines/Custom",
- "StepLines/Zoom",
-
- "StackedArea/Basic",
- "StackedArea/StepArea",
-
"Bars/Basic",
"Bars/AutoUpdate",
"Bars/Custom",
@@ -37,15 +28,13 @@ public static class Index
"Bars/RowsWithLabels",
"Bars/Layered",
- "StackedBars/Basic",
- "StackedBars/Groups",
-
"Pies/Basic",
"Pies/AutoUpdate",
//"Pies/Processing",
"Pies/Doughnut",
"Pies/Pushout",
"Pies/Custom",
+ "Pies/Icons",
"Pies/OutLabels",
"Pies/NightingaleRose",
"Pies/Gauges",
@@ -62,6 +51,12 @@ public static class Index
"Scatter/AutoUpdate",
"Scatter/Custom",
+ "StackedArea/Basic",
+ "StackedArea/StepArea",
+
+ "StackedBars/Basic",
+ "StackedBars/Groups",
+
"Financial/BasicCandlesticks",
"Error/Basic",
@@ -70,6 +65,13 @@ public static class Index
"Heat/Basic",
+ "StepLines/Basic",
+ "StepLines/AutoUpdate",
+ "StepLines/Properties",
+ "StepLines/Area",
+ "StepLines/Custom",
+ "StepLines/Zoom",
+
"Polar/Basic",
"Polar/RadialArea",
"Polar/Coordinates",
@@ -124,5 +126,5 @@ public static class Index
"Test/MotionCanvasDispose",
"Maps/World"
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Lines/Area/ViewModel.cs b/samples/ViewModelsSamples/Lines/Area/ViewModel.cs
index efe53a7e3..077f30aba 100644
--- a/samples/ViewModelsSamples/Lines/Area/ViewModel.cs
+++ b/samples/ViewModelsSamples/Lines/Area/ViewModel.cs
@@ -1,18 +1,16 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using LiveChartsCore;
+using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
using SkiaSharp;
namespace ViewModelsSamples.Lines.Area;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new LineSeries
{
- Values = new double[] { -2, -1, 3, 5, 3, 4, 6 },
+ Values = [-2, -1, 3, 5, 3, 4, 6],
// Set he Fill property to build an area series
// by default the series has a fill color based on your app theme
Fill = new SolidColorPaint(SKColors.CornflowerBlue), // mark
@@ -21,7 +19,7 @@ public partial class ViewModel : ObservableObject
GeometryFill = null,
GeometryStroke = null
}
- };
+ ];
// Creates a gray background and border in the draw margin.
public DrawMarginFrame DrawMarginFrame => new()
diff --git a/samples/ViewModelsSamples/Lines/AutoUpdate/ViewModel.cs b/samples/ViewModelsSamples/Lines/AutoUpdate/ViewModel.cs
index 3bb7e5786..f431b3b4c 100644
--- a/samples/ViewModelsSamples/Lines/AutoUpdate/ViewModel.cs
+++ b/samples/ViewModelsSamples/Lines/AutoUpdate/ViewModel.cs
@@ -1,8 +1,6 @@
using System;
-using System.Collections.Generic;
using System.Collections.ObjectModel;
-using System.ComponentModel;
-using CommunityToolkit.Mvvm.ComponentModel;
+using System.Linq;
using CommunityToolkit.Mvvm.Input;
using LiveChartsCore;
using LiveChartsCore.Defaults;
@@ -10,101 +8,88 @@
namespace ViewModelsSamples.Lines.AutoUpdate;
-public partial class ViewModel : ObservableObject
+public partial class ViewModel
{
private readonly Random _random = new();
- private readonly ObservableCollection _observableValues;
+
+ // We use the ObservableCollection class to let the chart know // mark
+ // when a new item is added or removed from the chart. // mark
+ public ObservableCollection Series { get; set; }
+
+ // The ObservablePoints property is an ObservableCollection of ObservableValue // mark
+ // it means that the chart is listening for changes in this collection // mark
+ // and also for changes in the properties of each element in the collection // mark
+ public ObservableCollection ObservableValues { get; set; }
public ViewModel()
{
- // Use ObservableCollections to let the chart listen for changes (or any INotifyCollectionChanged). // mark
- _observableValues =
- [
- // Use the ObservableValue or ObservablePoint types to let the chart listen for property changes // mark
- // or use any INotifyPropertyChanged implementation // mark
- new ObservableValue(2),
- new(5), // the ObservableValue type is redundant and inferred by the compiler (C# 9 and above)
- new(4),
- new(5),
- new(2),
- new(6),
- new(6),
- new(6),
- new(4),
- new(2),
- new(3),
- new(4),
- new(3)
+ ObservableValues = [
+ new() { Value = 2 },
+ new() { Value = 5 },
+ new() { Value = 4 }
];
- Series =
- [
- new LineSeries
- {
- Values = _observableValues,
- Fill = null
- }
+ Series = [
+ new LineSeries(ObservableValues)
];
-
- // in the following sample notice that the type int does not implement INotifyPropertyChanged
- // and our Series.Values property is of type List
- // List does not implement INotifyCollectionChanged
- // this means the following series is not listening for changes.
- // Series.Add(new ColumnSeries { Values = new List { 2, 4, 6, 1, 7, -2 } }); // mark
}
- public ObservableCollection Series { get; set; }
-
[RelayCommand]
public void AddItem()
{
var randomValue = _random.Next(1, 10);
- _observableValues.Add(new(randomValue));
+
+ // the new value is added to the collection // mark
+ // the chart is listening, and will update and animate the change // mark
+
+ ObservableValues.Add(new() { Value = randomValue });
}
[RelayCommand]
public void RemoveItem()
{
- if (_observableValues.Count == 0) return;
- _observableValues.RemoveAt(0);
+ if (ObservableValues.Count == 0) return;
+
+ // the last value is removed from the collection // mark
+ // the chart is listening, and will update and animate the change // mark
+
+ ObservableValues.RemoveAt(0);
}
[RelayCommand]
public void UpdateItem()
{
var randomValue = _random.Next(1, 10);
+ var lastItem = ObservableValues[ObservableValues.Count - 1];
- // we grab the last instance in our collection
- var lastInstance = _observableValues[_observableValues.Count - 1];
+ // becase lastItem is an ObservableObject and implements INotifyPropertyChanged // mark
+ // the chart is listening for changes in the Value property // mark
+ // and will update and animate the change // mark
- // finally modify the value property and the chart is updated!
- lastInstance.Value = randomValue;
+ lastItem.Value = randomValue;
}
[RelayCommand]
public void ReplaceItem()
{
var randomValue = _random.Next(1, 10);
- var randomIndex = _random.Next(0, _observableValues.Count - 1);
- _observableValues[randomIndex] = new(randomValue);
+ var randomIndex = _random.Next(0, ObservableValues.Count - 1);
+
+ // replacing and item also triggers the chart to update and animate the change // mark
+
+ ObservableValues[randomIndex] = new(randomValue);
}
[RelayCommand]
public void AddSeries()
{
- // for this sample only 5 series are supported.
- if (Series.Count == 5) return;
-
- Series.Add(
- new LineSeries
- {
- Values = new List
- {
- _random.Next(0, 10),
- _random.Next(0, 10),
- _random.Next(0, 10)
- }
- });
+ var values = Enumerable.Range(0, 3)
+ .Select(_ => _random.Next(0, 10))
+ .ToArray();
+
+ // a new line series is added to the chart // mark
+
+ Series.Add(new LineSeries(values));
}
[RelayCommand]
@@ -112,6 +97,12 @@ public void RemoveSeries()
{
if (Series.Count == 1) return;
+ // the last series is removed from the chart // mark
+
Series.RemoveAt(Series.Count - 1);
}
}
+
+// All LiveCharts objects (Series, Axes, etc) implement INotifyPropertyChanged // mark
+// this means that the chart is listening for changes in the properties // mark
+// the chart will reflect the changes and animate them // mark
diff --git a/samples/ViewModelsSamples/Lines/Basic/ViewModel.cs b/samples/ViewModelsSamples/Lines/Basic/ViewModel.cs
index 0f72dc28c..a6f7fd748 100644
--- a/samples/ViewModelsSamples/Lines/Basic/ViewModel.cs
+++ b/samples/ViewModelsSamples/Lines/Basic/ViewModel.cs
@@ -1,29 +1,32 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using LiveChartsCore;
+using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
-using LiveChartsCore.SkiaSharpView.Painting;
+using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using LiveChartsCore.SkiaSharpView.VisualElements;
-using SkiaSharp;
namespace ViewModelsSamples.Lines.Basic;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new LineSeries
{
- Values = new double[] { 2, 1, 3, 5, 3, 4, 6 },
- Fill = null
+ Values = [2, 1, 3, 5, 3, 4, 6],
+ Fill = null,
+ GeometrySize = 20
+ },
+ new LineSeries
+ {
+ Values = [4, 2, 5, 2, 4, 5, 3],
+ Fill = null,
+ GeometrySize = 20,
}
- };
+ ];
public LabelVisual Title { get; set; } =
new LabelVisual
{
Text = "My chart title",
TextSize = 25,
- Padding = new LiveChartsCore.Drawing.Padding(15),
- Paint = new SolidColorPaint(SKColors.DarkSlateGray)
+ Padding = new LiveChartsCore.Drawing.Padding(15)
};
}
diff --git a/samples/ViewModelsSamples/Lines/Custom/ViewModel.cs b/samples/ViewModelsSamples/Lines/Custom/ViewModel.cs
index b44e4cb00..b98731ad5 100644
--- a/samples/ViewModelsSamples/Lines/Custom/ViewModel.cs
+++ b/samples/ViewModelsSamples/Lines/Custom/ViewModel.cs
@@ -1,48 +1,47 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using LiveChartsCore;
+using LiveChartsCore;
using LiveChartsCore.Drawing;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
namespace ViewModelsSamples.Lines.Custom;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
public ISeries[] Series { get; set; } =
- {
+ [
new LineSeries
{
- Values = new double[] { 2, 1, 4, 2, 2, -5, -2 },
+ Values = [2, 1, 4, 2, 2, -5, -2],
Fill = null,
GeometrySize = 20
},
- // use the second type parameter to specify the geometry to draw for every point
- // there are already many predefined geometries in the
- // LiveChartsCore.SkiaSharpView.Drawing.Geometries namespace
- new LineSeries
+ // use the second generic parameter to define the geometry to draw
+ // there are many predefined geometries in the LiveChartsCore.Drawing namespace
+ // for example, the StarGeometry, CrossGeometry, RectangleGeometry and DiamondGeometry
+ new LineSeries
{
- Values = new double[] { 3, 3, -3, -2, -4, -3, -1 },
+ Values = [3, 3, -3, -2, -4, -3, -1],
Fill = null,
GeometrySize = 20
},
// You can also use SVG paths to draw the geometry
- // LiveCharts already provides some predefined paths in the SVGPoints class.
- new LineSeries
+ // the VariableSVGPathGeometry can change the drawn path at runtime
+ new LineSeries
{
- Values = new double[] { -2, 2, 1, 3, -1, 4, 3 },
+ Values = [-2, 2, 1, 3, -1, 4, 3],
Fill = null,
- GeometrySvg = SVGPoints.Star,
+ GeometrySvg = SVGPoints.Pin,
GeometrySize = 20
},
- // you can declare your own gemetry and use the SkiaSharp api to draw it
+ // finally you can also use SkiaSharp to draw your own geometry
new LineSeries
{
- Values = new double[] { 4, 5, 2, 4, 3, 2, 1 },
+ Values = [4, 5, 2, 4, 3, 2, 1],
Fill = null,
GeometrySize = 20
},
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Lines/CustomPoints/ViewModel.cs b/samples/ViewModelsSamples/Lines/CustomPoints/ViewModel.cs
new file mode 100644
index 000000000..0ee19888b
--- /dev/null
+++ b/samples/ViewModelsSamples/Lines/CustomPoints/ViewModel.cs
@@ -0,0 +1,76 @@
+using LiveChartsCore;
+using LiveChartsCore.ConditionalDraw;
+using LiveChartsCore.SkiaSharpView;
+using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
+using LiveChartsCore.SkiaSharpView.Painting;
+using SkiaSharp;
+
+namespace ViewModelsSamples.Lines.CustomPoints;
+
+public class ViewModel
+{
+ public ISeries[] Series { get; }
+
+ public ViewModel()
+ {
+ var lineSeries = new LineSeries(Fetch());
+
+ // we use the OnPointMeasured event to rotate the arrow // mark
+ // according to the Rotation property in the DataPoint class // mark
+ _ = lineSeries
+ .OnPointMeasured(point =>
+ {
+ point.Visual!.TransformOrigin = new(0f, 0f);
+ point.Visual!.RotateTransform = point.Model!.Rotation;
+ });
+
+ lineSeries.GeometrySize = 50;
+ lineSeries.GeometryStroke = null;
+ lineSeries.GeometryFill = new SolidColorPaint(SKColors.MediumVioletRed);
+ lineSeries.Fill = null;
+
+ // The Mapping property is used to map the data points to the series
+ // to learn more about the Mapping property visit:
+ // https://livecharts.dev/docs/{{ platform }}/{{ version }}/Overview.Mappers
+ lineSeries.Mapping = (dataPoint, index) => new(index, dataPoint.Value);
+
+ Series = [lineSeries];
+ }
+
+ public DataPoint[] Fetch()
+ {
+ return [
+ new DataPoint { Value = 4, Rotation = 0 },
+ new DataPoint { Value = 6, Rotation = 20 },
+ new DataPoint { Value = 8, Rotation = 90 },
+ new DataPoint { Value = 2, Rotation = 176 },
+ new DataPoint { Value = 7, Rotation = 55 },
+ new DataPoint { Value = 9, Rotation = 226 },
+ new DataPoint { Value = 3, Rotation = 320 }
+ ];
+ }
+}
+
+public class DataPoint
+{
+ public int Value { get; set; }
+ public float Rotation { get; set; }
+}
+
+
+public class ArrowGeometry : BaseSVGPathGeometry
+{
+ // svg path from:
+ // https://www.svgrepo.com/svg/525637/arrow-up
+
+ private static SKPath _path = SKPath.ParseSvgPathData(
+ "M12.75 20C12.75 20.4142 12.4142 20.75 12 20.75C11.5858 20.75 11.25 20.4142 11.25 " +
+ "20L11.25 10.75H6.00002C5.69668 10.75 5.4232 10.5673 5.30711 10.287C5.19103 10.0068 " +
+ "5.25519 9.68417 5.46969 9.46967L11.4697 3.46967C11.6103 3.32902 11.8011 3.25 12 " +
+ "3.25C12.1989 3.25 12.3897 3.32902 12.5304 3.46967L18.5304 9.46967C18.7449 9.68417 " +
+ "18.809 10.0068 18.6929 10.287C18.5768 10.5673 18.3034 10.75 18 10.75H12.75L12.75 20Z");
+
+ public ArrowGeometry()
+ : base(_path)
+ { }
+}
diff --git a/samples/ViewModelsSamples/Lines/Padding/ViewModel.cs b/samples/ViewModelsSamples/Lines/Padding/ViewModel.cs
index 3a930322b..5754bf170 100644
--- a/samples/ViewModelsSamples/Lines/Padding/ViewModel.cs
+++ b/samples/ViewModelsSamples/Lines/Padding/ViewModel.cs
@@ -1,5 +1,4 @@
using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore;
using LiveChartsCore.Drawing;
using LiveChartsCore.SkiaSharpView;
@@ -8,10 +7,9 @@
namespace ViewModelsSamples.Lines.Padding;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
// this series fits the draw margin area
// the key is to set the DataPadding to 0,0
// also remove GeometryStroke, GeometryFill and GeometrySize
@@ -24,7 +22,7 @@ public partial class ViewModel : ObservableObject
GeometrySize = 0,
DataPadding = new LvcPoint(0,0)
}
- };
+ ];
public DrawMarginFrame DrawMarginFrame => new()
{
diff --git a/samples/ViewModelsSamples/Lines/Properties/ViewModel.cs b/samples/ViewModelsSamples/Lines/Properties/ViewModel.cs
index 5b5c3ce22..b7945ec66 100644
--- a/samples/ViewModelsSamples/Lines/Properties/ViewModel.cs
+++ b/samples/ViewModelsSamples/Lines/Properties/ViewModel.cs
@@ -1,5 +1,4 @@
-
-using System;
+using System;
using System.Collections.Generic;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
@@ -27,7 +26,7 @@ public ViewModel()
LineSmoothness = 0.5
};
- _series = new ISeries[] { _lineSeries };
+ _series = [_lineSeries];
}
[ObservableProperty]
@@ -56,7 +55,7 @@ public void ChangeSeriesInstance()
LineSmoothness = 0.5
};
- Series = new ISeries[] { _lineSeries };
+ Series = [_lineSeries];
}
[RelayCommand]
diff --git a/samples/ViewModelsSamples/Lines/Straight/ViewModel.cs b/samples/ViewModelsSamples/Lines/Straight/ViewModel.cs
index 5a48d633c..79d7d2db7 100644
--- a/samples/ViewModelsSamples/Lines/Straight/ViewModel.cs
+++ b/samples/ViewModelsSamples/Lines/Straight/ViewModel.cs
@@ -1,16 +1,14 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using LiveChartsCore;
+using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
namespace ViewModelsSamples.Lines.Straight;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new LineSeries
{
- Values = new double[] { 5, 0, 5, 0, 5, 0 },
+ Values = [5, 0, 5, 0, 5, 0],
Fill = null,
GeometrySize = 0,
// use the line smoothness property to control the curve
@@ -20,10 +18,10 @@ public partial class ViewModel : ObservableObject
},
new LineSeries
{
- Values = new double[] { 7, 2, 7, 2, 7, 2 },
+ Values = [7, 2, 7, 2, 7, 2],
Fill = null,
GeometrySize = 0,
LineSmoothness = 1 // mark
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Lines/XY/ViewModel.cs b/samples/ViewModelsSamples/Lines/XY/ViewModel.cs
index 551124902..a2400373c 100644
--- a/samples/ViewModelsSamples/Lines/XY/ViewModel.cs
+++ b/samples/ViewModelsSamples/Lines/XY/ViewModel.cs
@@ -1,24 +1,21 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using LiveChartsCore;
+using LiveChartsCore;
using LiveChartsCore.Defaults;
using LiveChartsCore.SkiaSharpView;
namespace ViewModelsSamples.Lines.XY;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ISeries[] Series { get; set; } =
- {
+ public ISeries[] Series { get; set; } = [
new LineSeries
{
- Values = new ObservablePoint[]
- {
+ Values = [
new ObservablePoint(0, 4),
new ObservablePoint(1, 3),
new ObservablePoint(3, 8),
new ObservablePoint(18, 6),
new ObservablePoint(20, 12)
- }
+ ]
}
- };
+ ];
}
diff --git a/samples/ViewModelsSamples/Lines/Zoom/ViewModel.cs b/samples/ViewModelsSamples/Lines/Zoom/ViewModel.cs
index b9a7fd608..286ef6e38 100644
--- a/samples/ViewModelsSamples/Lines/Zoom/ViewModel.cs
+++ b/samples/ViewModelsSamples/Lines/Zoom/ViewModel.cs
@@ -1,13 +1,16 @@
using System;
-using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
namespace ViewModelsSamples.Lines.Zoom;
-public partial class ViewModel : ObservableObject
+public class ViewModel
{
- public ViewModel()
+ public ISeries[] SeriesCollection { get; set; } = [
+ new LineSeries(Fetch())
+ ];
+
+ private static int[] Fetch()
{
var values = new int[100];
var r = new Random();
@@ -19,8 +22,6 @@ public ViewModel()
values[i] = t;
}
- SeriesCollection = new ISeries[] { new LineSeries { Values = values } };
+ return values;
}
-
- public ISeries[] SeriesCollection { get; set; }
-}
+ }
diff --git a/samples/ViewModelsSamples/Maps/World/ViewModel.cs b/samples/ViewModelsSamples/Maps/World/ViewModel.cs
index fc892b2da..0c2232b4c 100644
--- a/samples/ViewModelsSamples/Maps/World/ViewModel.cs
+++ b/samples/ViewModelsSamples/Maps/World/ViewModel.cs
@@ -1,7 +1,6 @@
using System;
using System.Linq;
using System.Threading.Tasks;
-using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using LiveChartsCore.Geo;
using LiveChartsCore.SkiaSharpView;
@@ -9,10 +8,10 @@
namespace ViewModelsSamples.Maps.World;
-public partial class ViewModel
+public partial class ViewModel
{
private bool _isBrazilInChart = true;
- private readonly IWeigthedMapLand _brazil;
+ private readonly HeatLand _brazil;
private readonly Random _r = new();
public ViewModel()
@@ -39,7 +38,7 @@ public ViewModel()
new() { Name = "are", Value = 13 }
};
- Series = new HeatLandSeries[] { new HeatLandSeries { Lands = lands } };
+ Series = [new HeatLandSeries { Lands = lands }];
_brazil = lands.First(x => x.Name == "bra");
DoRandomChanges();
@@ -60,7 +59,7 @@ public void ToggleBrazil()
return;
}
- Series[0].Lands = lands.Concat(new[] { _brazil }).ToArray();
+ Series[0].Lands = [.. lands, _brazil];
_isBrazilInChart = true;
}
diff --git a/samples/ViewModelsSamples/Pies/AngularGauge/ViewModel.cs b/samples/ViewModelsSamples/Pies/AngularGauge/ViewModel.cs
index 85be2fdb4..439c2625b 100644
--- a/samples/ViewModelsSamples/Pies/AngularGauge/ViewModel.cs
+++ b/samples/ViewModelsSamples/Pies/AngularGauge/ViewModel.cs
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using LiveChartsCore;
-using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Extensions;
using LiveChartsCore.VisualElements;
@@ -12,10 +11,14 @@
namespace ViewModelsSamples.Pies.AngularGauge;
-public partial class ViewModel : ObservableObject
+public partial class ViewModel
{
private readonly Random _random = new();
+ public IEnumerable Series { get; set; }
+ public IEnumerable> VisualElements { get; set; }
+ public NeedleVisual Needle { get; set; }
+
public ViewModel()
{
var sectionsOuter = 130;
@@ -31,8 +34,8 @@ public ViewModel()
new GaugeItem(30, s => SetStyle(sectionsOuter, sectionsWidth, s)),
new GaugeItem(10, s => SetStyle(sectionsOuter, sectionsWidth, s)));
- VisualElements = new VisualElement[]
- {
+ VisualElements =
+ [
new AngularTicksVisual
{
Labeler = value => value.ToString("N1"),
@@ -42,15 +45,9 @@ public ViewModel()
TicksLength = 20
},
Needle
- };
+ ];
}
- public IEnumerable Series { get; set; }
-
- public IEnumerable> VisualElements { get; set; }
-
- public NeedleVisual Needle { get; set; }
-
[RelayCommand]
public void DoRandomChange()
{
diff --git a/samples/ViewModelsSamples/Pies/AutoUpdate/ViewModel.cs b/samples/ViewModelsSamples/Pies/AutoUpdate/ViewModel.cs
index 5ccd9e9c0..a51f1aeea 100644
--- a/samples/ViewModelsSamples/Pies/AutoUpdate/ViewModel.cs
+++ b/samples/ViewModelsSamples/Pies/AutoUpdate/ViewModel.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using LiveChartsCore;
using LiveChartsCore.Defaults;
@@ -8,7 +7,7 @@
namespace ViewModelsSamples.Pies.AutoUpdate;
-public partial class ViewModel : ObservableObject
+public partial class ViewModel
{
private readonly Random _random = new();
@@ -19,12 +18,12 @@ public ViewModel()
[
// Use the ObservableValue or ObservablePoint types to let the chart listen for property changes // mark
// or use any INotifyPropertyChanged implementation // mark
- new PieSeries { Values = new[] { new ObservableValue(2) } },
- new PieSeries { Values = new[] { new ObservableValue(5) } },
- new PieSeries { Values = new[] { new ObservableValue(3) } },
- new PieSeries { Values = new[] { new ObservableValue(7) } },
- new PieSeries { Values = new[] { new ObservableValue(4) } },
- new PieSeries { Values = new[] { new ObservableValue(3) } }
+ new PieSeries { Values = [new ObservableValue(2)] },
+ new PieSeries { Values = [new ObservableValue(5)] },
+ new PieSeries { Values = [new ObservableValue(3)] },
+ new PieSeries