<chart:BarSeries .. >
<chart:BarSeries.DataMarker>
<chart:ChartDataMarker.LabelStyle>
<chart:DataMarkerLabelStyle LabelPosition="Outer"/>
</chart:ChartDataMarker.LabelStyle>
</chart:BarSeries.DataMarker>
</chart:BarSeries> |
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis IsVisible="False" ShowMajorGridLines="False" ActualRangeChanged="NumericalAxis_ActualRangeChanged" ShowMinorGridLines="False"/> </chart:SfChart.SecondaryAxis> |
private void NumericalAxis_ActualRangeChanged(object sender, ActualRangeChangedEventArgs e)
{
var delta = (double)e.ActualMaximum - (double)e.ActualMinimum;
e.ActualMaximum = e.VisibleMaximum = (double)e.ActualMaximum + (0.15 * delta); // increase 15% of axis height compare to default.
} |
<StackLayout>
<chart:SfChart HorizontalOptions="FillAndExpand" HeightRequest="300" BackgroundColor="#5353c6" >
. . .
. . .
</StackLayout> |
Note: The Width property used to specify the rectangle bar size, the default value of the width is 0.8, and the value ranges from 0 to 1. Here, 1 and 0 correspond to 100% and 0% of the available
<chart:BarSeries ItemsSource="{Binding BarSeriesCollection_One}" XBindingPath="Department" Width="0.3" YBindingPath="YValues" Color="#33d6ff" >
. . .
</chart:BarSeries>
|