private void XValueFormatter(object sender, LabelCreatedEventArgs e) {What can I do to achieve my task?
double val = Convert.ToDouble(e.AxisLabel.LabelContent);
if (Math.Abs(val) < 0.1)
e.AxisLabel.LabelContent = val.ToString("G1", CultureInfo.InvariantCulture);
else
e.AxisLabel.LabelContent = val;
}
Hi Jeremie,
Thank you for contacting Syncfusion Support.
We have achieved your requirement by applying the required format for the axis label in LabelCreated event as like in the below code sample.
Code Snippet [C#]
private void XValueFormatter(object sender, LabelCreatedEventArgs e) { var axisLabel = e.AxisLabel; axisLabel.LabelContent = string.Format("{0:0.#######}", axisLabel.Position); } |
Regards,
Samuel
|
|