Skip to content

Latest commit

 

History

History
103 lines (74 loc) · 2.63 KB

File metadata and controls

103 lines (74 loc) · 2.63 KB
layout post
title Axis padding in WinUI Chart control | Syncfusion
description Learn here all about how to set padding for chart axis in Syncfusion WinUI Chart (SfCartesianChart) control.
platform WinUI
control SfCartesianChart
documentation ug
keywords axis padding in winui chart, winui sfcartesianchart axis padding, winui chart axis padding customization, syncfusion winui chart axis padding.

Axis Padding in WinUI Chart (SfCartesianChart)

PlotOffsetStart

The PlotOffsetStart property is used to provide padding to the axis at start position. The following code sample demonstrates the padding applied to Start position for both x and y-axes.

{% tabs %}

{% highlight xaml %}

chart:SfCartesianChart . . . chart:SfCartesianChart.XAxes <chart:CategoryAxis PlotOffsetStart="30"/> </chart:SfCartesianChart.XAxes>

chart:SfCartesianChart.YAxes <chart:NumericalAxis PlotOffsetStart="30"/> </chart:SfCartesianChart.YAxes>

</chart:SfCartesianChart>

{% endhighlight %}

{% highlight c# %}

SfCartesianChart chart = new SfCartesianChart(); . . . CategoryAxis primaryAxis = new CategoryAxis() { PlotOffsetStart = 30 }; chart.XAxes.Add(primaryAxis);

NumericalAxis secondaryAxis = new NumericalAxis() { PlotOffsetStart = 30 }; chart.YAxes.Add(secondaryAxis); . . . this.Content = chart;

{% endhighlight %}

{% endtabs %}

PlotOffsetStart support in WinUI Chart

PlotOffsetEnd

The PlotOffsetEnd property is used to provide padding to the axis at end position. The following code sample demonstrates the padding applied to end position for both x and y-axes.

{% tabs %}

{% highlight xaml %}

chart:SfCartesianChart . . . chart:SfCartesianChart.XAxes <chart:CategoryAxis PlotOffsetEnd="30"/> </chart:SfCartesianChart.XAxes>

chart:SfCartesianChart.YAxes <chart:NumericalAxis PlotOffsetEnd="30"/> </chart:SfCartesianChart.YAxes>

</chart:SfCartesianChart>

{% endhighlight %}

{% highlight c# %}

SfCartesianChart chart = new SfCartesianChart(); . . . CategoryAxis primaryAxis = new CategoryAxis() { PlotOffsetEnd = 30 }; chart.XAxes.Add(primaryAxis);

NumericalAxis secondaryAxis = new NumericalAxis() { PlotOffsetEnd = 30 }; chart.YAxes.Add(secondaryAxis); . . . this.Content = chart;

{% endhighlight %}

{% endtabs %}

PlotOffsetEnd support in WinUI Chart