We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Format not working for series points and XAxis

Thread ID:

Created:

Updated:

Platform:

Replies:

96402 Sep 10,2010 06:22 AM Sep 14,2010 04:43 AM ASP.NET Web Forms (Classic) 2
loading
Tags: Chart
Daniel Blendea
Asked On September 10, 2010 06:22 AM

Hi,

I have a line chart, bound to a List.
The chart displays the data, however there are 2 issues:

1. the points' values are float with many decimals.
I need to display only 2 decimals.

ChartSeries userScoreSeries;

I tried
userScoreSeries.Style.TextFormat = "0#.##";

but it doesn't work, instead of formatted values, I get only "0#.##"

2. The X axis has dates, which need to be formated to a certain country and certain format.

I tried

saveScoreChart.PrimaryXAxis.ValueType = ChartValueType.DateTime;
saveScoreChart.PrimaryXAxis.Format = "dd MMMM yyyy";

No luck.

I tried attaching an event handler to FormatLabel and set the format in the handler:

void PrimaryXAxis_FormatLabel( object sender, ChartFormatAxisLabelEventArgs e )
{
e.Label = e.ValueAsDate.ToString("dd MMMM yyyy");
e.Handled = true;
}

I get some strange values, don't know from where, formatted as dates, which are tottaly wrong.


Can someone tell me how to format the series and the axis?

Thanks,
Daniel


Daniel Blendea
Replied On September 13, 2010 02:58 AM

Anybody?


Jaffersathick B [Syncfusion]
Replied On September 14, 2010 04:43 AM

Hi Daniel,

Thank you for using Syncfusion products.
We suggest you to use the DateTimeFormat property of the Primary X axis to format the datetime value of the Chart Axis labels.

Please refer the documentation from the following link:


http://help.syncfusion.com/ug_83/User%20Interface/ASP.NET/Chart/default.htm?turl=Documents/axislabeltextformattingappearanceandpositioning.htm

Let me know if it helps.
Regards,
Jaffer



CONFIRMATION

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.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;