Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145209 | Jun 12,2019 01:18 PM UTC | Jun 13,2019 11:12 AM UTC | Xamarin.Forms | 1 |
![]() |
Tags: SfChart |
<chart:NumericalAxis x:Name="XAxis" LabelCreated="LabelCreated" EdgeLabelsVisibilityMode="AlwaysVisible" EdgeLabelsDrawingMode="Fit" Minimum="0" Maximum="24" Interval="3" ShowMajorGridLines="False" ShowMinorGridLines="False">
. . .
</chart:NumericalAxis> |
private void LabelCreated(object sender, ChartAxisLabelEventArgs e)
{
var axis = sender as NumericalAxis;
if(axis == chart.SecondaryAxis && e.Position == axis.Maximum)
{
e.LabelContent = "KWh";
e.LabelStyle = new ChartAxisLabelStyle() { FontAttributes = FontAttributes.Bold };
}
else if(axis == chart.PrimaryAxis && e.Position == axis.Maximum)
{
e.LabelContent += "h";
e.LabelStyle = new ChartAxisLabelStyle() { FontAttributes = FontAttributes.Bold };
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.