Skip to content

Commit dca1cf2

Browse files
Merge pull request #3690 from syncfusion-content/Migrate-Toolkit-DateTimeCategory-axis-UG-to-internal-UG
982970-Migrate toolkit date time category axis ug to internal ug
2 parents 8063ac3 + f7b76ff commit dca1cf2

File tree

6 files changed

+148
-3
lines changed

6 files changed

+148
-3
lines changed
49.3 KB
Loading
23.4 KB
Loading

MAUI/Cartesian-Charts/Axis/Types.md

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
22
layout: post
3-
title: Axis types in .NET MAUI Chart control | Syncfusion
3+
title: Axis types in .NET MAUI Cartesian Chart control | Syncfusion
44
description: Learn here all about axis types and its features in Syncfusion® .NET MAUI Chart (SfCartesianChart) control and more.
55
platform: maui
66
control: SfCartesianChart
77
documentation: ug
88
keywords: .net maui cartesian charts, .net maui axis types, cartesian chart axis types, syncfusion cartesian charts maui, maui chart axis customization, .net maui chart axis, cartesian chart axis guide maui, .net maui sfCartesianChart axis.
99
---
1010

11-
# Types of Axis in .NET MAUI Chart
11+
# Types of Axis in .NET MAUI Cartesian Chart
1212

1313
Cartesian chart supports the following types of chart axis.
1414

1515
* NumericalAxis
1616
* CategoryAxis
1717
* DateTimeAxis
18+
* DateTimeCategoryAxis
1819
* LogarithmicAxis
1920

2021
## Numerical Axis
@@ -417,6 +418,78 @@ this.Content = chart;
417418

418419
![DateTimeAxis range customization support in MAUI Chart](Axis_Images/maui_chart_datetime_axis_range.jpg)
419420

421+
## DateTimeCategoryAxis
422+
423+
The `DateTimeCategoryAxis` is a specialized type of axis primarily used with financial series. Similar to the [CategoryAxis](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.CategoryAxis.html), all data points are plotted with equal spacing, eliminating gaps for missing dates. The intervals and ranges for this axis are calculated similarly to the [DateTimeAxis](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.DateTimeAxis.html). There are no visual gaps between points, even if the difference between two points exceeds a year.
424+
425+
{% tabs %}
426+
427+
{% highlight xaml %}
428+
429+
<chart:SfCartesianChart>
430+
. . .
431+
<chart:SfCartesianChart.XAxes>
432+
<chart:DateTimeCategoryAxis/>
433+
</chart:SfCartesianChart.XAxes>
434+
. . .
435+
</chart:SfCartesianChart>
436+
437+
{% endhighlight %}
438+
439+
{% highlight c# %}
440+
441+
SfCartesianChart chart = new SfCartesianChart();
442+
. . .
443+
// Create an instance of the DateTimeCategoryAxis, used for displaying DateTime values as categories
444+
DateTimeCategoryAxis primaryAxis = new DateTimeCategoryAxis();
445+
// Add the DateTimeCategoryAxis instance to the chart's XAxes collection
446+
chart.XAxes.Add(primaryAxis);
447+
448+
this.Content = chart;
449+
450+
{% endhighlight %}
451+
452+
{% endtabs %}
453+
454+
![DateTimeCategory Axis support in MAUI Chart](Axis_Images/maui_dateTimeCategory_axis.png)
455+
456+
### Interval
457+
458+
In `DateTimeCategoryAxis`, intervals can be customized by using the Interval and IntervalType properties, similar to [DateTimeAxis](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.DateTimeAxis.html). For example, setting `Interval` as 5 and `IntervalType` as `Days` will consider 5 days as an interval.
459+
{% tabs %}
460+
461+
{% highlight xaml %}
462+
463+
<chart:SfCartesianChart>
464+
. . .
465+
<chart:SfCartesianChart.XAxes>
466+
<chart:DateTimeCategoryAxis Interval="5"
467+
IntervalType="Days"/>
468+
</chart:SfCartesianChart.XAxes>
469+
. . .
470+
</chart:SfCartesianChart>
471+
472+
{% endhighlight %}
473+
474+
{% highlight c# %}
475+
476+
SfCartesianChart chart = new SfCartesianChart();
477+
. . .
478+
DateTimeCategoryAxis primaryAxis = new DateTimeCategoryAxis()
479+
{
480+
Interval = 5,
481+
IntervalType = DateTimeIntervalType.Days
482+
};
483+
chart.XAxes.Add(primaryAxis);
484+
. . .
485+
this.Content = chart;
486+
487+
{% endhighlight %}
488+
489+
{% endtabs %}
490+
491+
![DateTimeCategoryAxis interval support in MAUI Chart](Axis_Images/maui_dateTimeCategory_interval.png)
492+
420493
## Logarithmic Axis
421494

422495
The [LogarithmicAxis](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.LogarithmicAxis.html) uses a logarithmic scale, and it is very useful in visualizing data when the given data range has a big difference. It can be used either on the x-axis or the chart's y-axis.

MAUI/Cartesian-Charts/PlotBand.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Plot bands are classified into [NumericalPlotBand](https://help.syncfusion.com/c
2626

2727
## Numerical PlotBand
2828

29-
[NumericalPlotBands](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.NumericalPlotBand.html) are used to draw plot bands for [NumericalAxis](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.NumericalAxis.html) and [CategoryAxis](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.CategoryAxis.html). To add a plot band, create an instance of [NumericalPlotBandCollection](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.NumericalPlotBandCollection.html) and specify numerical value for the [Start](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.NumericalPlotBand.html#Syncfusion_Maui_Charts_NumericalPlotBand_Start) and [End](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.NumericalPlotBand.html#Syncfusion_Maui_Charts_NumericalPlotBand_End) parameter. These parameters determine the beginning and end of the plot band.
29+
[NumericalPlotBands](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.NumericalPlotBand.html) are used to draw plot bands for [NumericalAxis](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.NumericalAxis.html), [CategoryAxis](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.CategoryAxis.html), and `DateTimeCategoryAxis`. To add a plot band, create an instance of [NumericalPlotBandCollection](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.NumericalPlotBandCollection.html) and specify numerical value for the [Start](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.NumericalPlotBand.html#Syncfusion_Maui_Charts_NumericalPlotBand_Start) and [End](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.NumericalPlotBand.html#Syncfusion_Maui_Charts_NumericalPlotBand_End) parameter. These parameters determine the beginning and end of the plot band.
3030

3131
{% tabs %}
3232

43.6 KB
Loading

MAUI/Polar-Charts/Axis/Types.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Polar chart supports the following types of chart axis.
1414
* NumericalAxis
1515
* CategoryAxis
1616
* DateTimeAxis
17+
* DateTimeCategoryAxis
1718

1819
## Numerical Axis
1920

@@ -310,6 +311,77 @@ this.Content = chart;
310311

311312
{% endtabs %}
312313

314+
## DateTimeCategoryAxis
315+
316+
The `DateTimeCategoryAxis` is a specialized type of axis primarily used with financial series. Similar to the [CategoryAxis](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.CategoryAxis.html), all data points are plotted with equal spacing, eliminating gaps for missing dates. The intervals and ranges for this axis are calculated similarly to the [DateTimeAxis](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.DateTimeAxis.html). There are no visual gaps between points, even if the difference between two points exceeds a year.
317+
318+
{% tabs %}
319+
320+
{% highlight xaml %}
321+
322+
<chart:SfPolarChart>
323+
. . .
324+
<chart:SfPolarChart.PrimaryAxis>
325+
<chart:DateTimeCategoryAxis/>
326+
</chart:SfPolarChart.PrimaryAxis>
327+
. . .
328+
</chart:SfPolarChart>
329+
330+
{% endhighlight %}
331+
332+
{% highlight c# %}
333+
334+
SfPolarChart chart = new SfPolarChart();
335+
. . .
336+
// Create an instance of the DateTimeCategoryAxis, used for displaying DateTime values as categories
337+
DateTimeCategoryAxis primaryAxis = new DateTimeCategoryAxis();
338+
// Add the DateTimeCategoryAxis instance to the chart's XAxes collection
339+
chart.PrimaryAxis.Add(primaryAxis);
340+
. . .
341+
this.Content = chart;
342+
343+
{% endhighlight %}
344+
345+
{% endtabs %}
346+
347+
![DateTimeCategory Axis support in MAUI Chart](Axis_Images/maui_dateTimeCategory_axis.png)
348+
349+
### Interval
350+
351+
In `DateTimeCategoryAxis`, intervals can be customized by using the Interval and IntervalType properties, similar to [DateTimeAxis](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.DateTimeAxis.html). For example, setting `Interval` as 3 and `IntervalType` as `Months` will consider 3 months as interval.
352+
353+
{% tabs %}
354+
355+
{% highlight xaml %}
356+
357+
<chart:SfPolarChart>
358+
. . .
359+
<chart:SfPolarChart.PrimaryAxis>
360+
<chart:DateTimeCategoryAxis Interval="3"
361+
IntervalType="Months"/>
362+
</chart:SfPolarChart.PrimaryAxis>
363+
. . .
364+
</chart:SfPolarChart>
365+
366+
{% endhighlight %}
367+
368+
{% highlight c# %}
369+
370+
SfPolarChart chart = new SfPolarChart();
371+
. . .
372+
DateTimeCategoryAxis primaryAxis = new DateTimeCategoryAxis()
373+
{
374+
Interval = 3,
375+
IntervalType = DateTimeIntervalType.Months
376+
};
377+
chart.PrimaryAxis.Add(primaryAxis);
378+
. . .
379+
this.Content = chart;
380+
381+
{% endhighlight %}
382+
383+
{% endtabs %}
384+
313385
## Inversed
314386

315387
Axis can be inverted using the [IsInversed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartAxis.html#Syncfusion_Maui_Charts_ChartAxis_IsInversed) property. The default value of this property is `False`.

0 commit comments

Comments
 (0)