DateTimeAxis dateTimeAxis = new DateTimeAxis();
//Using this event we can get the actual labels and position.
dateTimeAxis.LabelCreated += dateTimeAxis_LabelCreated;
//This code is used to apply the label format to ChartAxis labels.
dateTimeAxis.LabelStyle.LabelFormat = "dd/MM/yyyy";
void dateTimeAxis_LabelCreated(object sender, ChartAxisLabelEventArgs e)
{
} |
<chart:SfChart.PrimaryAxis>
<chart:DateTimeAxis x:Name="dateTimeAxis" LabelCreated="dateTimeAxis_LabelCreated">
<chart:DateTimeAxis.LabelStyle>
<chart:ChartAxisLabelStyle LabelFormat="dd/MM/yyyy"/>
</chart:DateTimeAxis.LabelStyle>
</chart:DateTimeAxis>
</chart:SfChart.PrimaryAxis>
|