From 8ab33f3b6a9b93c0eadf7172cc62a0598cbf7551 Mon Sep 17 00:00:00 2001 From: Vallarasu4653 Date: Tue, 25 Nov 2025 16:37:20 +0530 Subject: [PATCH 1/2] Added the axis type UG content for Spark chart --- maui-toolkit-toc.html | 1 + maui-toolkit/Spark-Charts/getting-started.md | 2 +- .../Spark-Charts/sparkchart-axis-types.md | 117 ++++++++++++++++++ 3 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 maui-toolkit/Spark-Charts/sparkchart-axis-types.md diff --git a/maui-toolkit-toc.html b/maui-toolkit-toc.html index 128b8b1d..d8507211 100644 --- a/maui-toolkit-toc.html +++ b/maui-toolkit-toc.html @@ -481,6 +481,7 @@
  • Overview
  • Getting Started
  • Sparkline Types
  • +
  • Axis types
  • Markers
  • Customize Data Points
  • diff --git a/maui-toolkit/Spark-Charts/getting-started.md b/maui-toolkit/Spark-Charts/getting-started.md index 625ac270..e2336cb6 100644 --- a/maui-toolkit/Spark-Charts/getting-started.md +++ b/maui-toolkit/Spark-Charts/getting-started.md @@ -405,7 +405,7 @@ The following code example gives you the complete code of above configurations. {% highlight xaml %} -ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" + + + +{% endhighlight %} + +{% highlight c# %} + +SfSparkColumnChart sparkchart = new SfSparkColumnChart() +{ + ItemsSource = new SparkChartViewModel().Data, + YBindingPath = "Value", + XBindingPath = "OrderName", + AxisType = SparkChartAxisType.Category +}; +this.Content = sparkchart; + +{% endhighlight %} + +{% endtabs %} + + +### DateTime AxisType + +The `DateTime` AxisType treats X-axis values as date-time instances. This axis type is used to emphasize changes in values over time, primarily for communicating trends and chronological data visualization rather than individual data values. + +{% tabs %} + +{% highlight xaml %} + + + + +{% endhighlight %} + +{% highlight c# %} + +SfSparkAreaChart sparkchart = new SfSparkAreaChart() +{ + ItemsSource = new SparkChartViewModel().Data, + YBindingPath = "Value", + XBindingPath = "OrderDate", + AxisType = SparkChartAxisType.DateTime +}; + +this.Content = sparkchart; + +{% endhighlight %} + +{% endtabs %} + + +### Numeric AxisType + +The `Numeric` AxisType treats X-axis values as numbers. Use this when your X-axis data contains numerical values that represent quantities, indices, or continuous numerical data on a numerical scale. + +{% tabs %} + +{% highlight xaml %} + + + + +{% endhighlight %} + +{% highlight c# %} + +SfSparkWinLossChart sparkchart = new SfSparkWinLossChart() +{ + ItemsSource = new SparkChartViewModel().Data, + YBindingPath = "Value", + XBindingPath = "OrderID", + AxisType = SparkChartAxisType.Numeric +}; +this.Content = sparkchart; + +{% endhighlight %} + +{% endtabs %} From 308673a667aead0d96c9b32c945d2ee963e795bf Mon Sep 17 00:00:00 2001 From: Vallarasu4653 Date: Fri, 28 Nov 2025 18:43:14 +0530 Subject: [PATCH 2/2] addressed review suggestion --- maui-toolkit/Spark-Charts/sparkchart-axis-types.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/maui-toolkit/Spark-Charts/sparkchart-axis-types.md b/maui-toolkit/Spark-Charts/sparkchart-axis-types.md index 6ed4b3c0..3eea74bf 100644 --- a/maui-toolkit/Spark-Charts/sparkchart-axis-types.md +++ b/maui-toolkit/Spark-Charts/sparkchart-axis-types.md @@ -18,7 +18,7 @@ The `XBindingPath` property specifies the data source property that contains the ## AxisType Property -The `AxisType` property of the SfSparkLineChart determines how the chart interprets the X-axis values. It accepts the following SparkChartAxisType enum values like Category, DateTime and Numeric. Its default value is `SparkChartAxisType.Numeric`. +The `AxisType` property of the spark charts determines how the chart interprets the X-axis values. It accepts the following SparkChartAxisType enum values like Category, DateTime and Numeric. Its default value is `SparkChartAxisType.Numeric`. ### Category AxisType @@ -70,7 +70,7 @@ The `DateTime` AxisType treats X-axis values as date-time instances. This axis t {% highlight c# %} -SfSparkAreaChart sparkchart = new SfSparkAreaChart() +SfSparkColumnChart sparkchart = new SfSparkColumnChart() { ItemsSource = new SparkChartViewModel().Data, YBindingPath = "Value", @@ -103,7 +103,7 @@ The `Numeric` AxisType treats X-axis values as numbers. Use this when your X-axi {% highlight c# %} -SfSparkWinLossChart sparkchart = new SfSparkWinLossChart() +SfSparkColumnChart sparkchart = new SfSparkColumnChart() { ItemsSource = new SparkChartViewModel().Data, YBindingPath = "Value",