-
Notifications
You must be signed in to change notification settings - Fork 5
Added the Axis type UG content for Spark chart .NET MAUI Toolkit #390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Vallarasu4653
wants to merge
2
commits into
development
Choose a base branch
from
add_sparkchart_axistype_content
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| --- | ||
| layout: post | ||
| title: Axis types in .NET MAUI Spark Chart Control | Syncfusion | ||
| description: Learn here all about Axis types supported in Syncfusion® .NET MAUI Spark Charts (SfSparkChart) control and more. | ||
| platform: maui-toolkit | ||
| control: SfSparkChart | ||
| documentation: ug | ||
| keywords: maui spark chart axis, spark chart numeric axis, spark chart category axis, spark chart datetime axis, maui sparkline axis types, spark chart axis customization | ||
| --- | ||
|
|
||
| # Axis types in .NET MAUI Spark Charts | ||
|
|
||
| Spark charts consist of two axes for measuring and categorizing data: a vertical (Y) axis and a horizontal (X) axis. The Y-axis always uses a numerical scale to measure data values, while the X-axis provides flexibility to change its type using the `AxisType` property, supporting Numeric, Category, and DateTime scales. | ||
|
|
||
| ## XBindingPath Property | ||
|
|
||
| The `XBindingPath` property specifies the data source property that contains the X-axis values. It binds your collection’s data to the horizontal axis of the spark chart. | ||
|
|
||
| ## 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`. | ||
|
|
||
| ### Category AxisType | ||
|
|
||
| The `Category` AxisType treats X-axis values as discrete categories. Use this for categorical or text-based data where each data point represents a distinct group or classification. | ||
|
|
||
| {% tabs %} | ||
|
|
||
| {% highlight xaml %} | ||
|
|
||
| <sparkchart:SfSparkColumnChart ItemsSource="{Binding Data}" | ||
| YBindingPath="Value" | ||
| XBindingPath="OrderName" | ||
| AxisType="Category"> | ||
| </sparkchart:SfSparkColumnChart> | ||
|
|
||
| {% 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 %} | ||
|
|
||
| <sparkchart:SfSparkColumnChart ItemsSource="{Binding Data}" | ||
| YBindingPath="Value" | ||
| XBindingPath="OrderDate" | ||
| AxisType="DateTime"> | ||
| </sparkchart:SfSparkColumnChart> | ||
|
|
||
| {% 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 %} | ||
|
|
||
| <sparkchart:SfSparkColumnChart ItemsSource="{Binding Data}" | ||
| YBindingPath="Value" | ||
| XBindingPath="OrderID" | ||
| AxisType="Numeric"> | ||
| </sparkchart:SfSparkColumnChart> | ||
|
|
||
| {% endhighlight %} | ||
|
|
||
| {% highlight c# %} | ||
|
|
||
| SfSparkWinLossChart sparkchart = new SfSparkWinLossChart() | ||
| { | ||
| ItemsSource = new SparkChartViewModel().Data, | ||
| YBindingPath = "Value", | ||
| XBindingPath = "OrderID", | ||
| AxisType = SparkChartAxisType.Numeric | ||
| }; | ||
| this.Content = sparkchart; | ||
|
|
||
| {% endhighlight %} | ||
|
|
||
| {% endtabs %} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.