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.

Axis Lable

Thread ID:

Created:

Updated:

Platform:

Replies:

83927 Jun 28,2009 04:46 AM Jun 30,2009 09:17 AM Windows Forms 2
loading
Tags: Chart
smh
Asked On June 28, 2009 04:46 AM

Hi,
I want Set XAxisLable Manualy,
In a for block i set my Series :
for (int i = 0; i < n ; i++)
{
string Title = items[i];
ChartSeries series = new ChartSeries();
series.Name = Title;
series.Points.Add(i, result[i]);
series.Type = ChartSeriesType.StackingColumn;
series.Text = series.Name;
chart1.Series.Add(series);
series.PrepareStyle += new ChartPrepareStyleInfoHandler(series_PrepareStyle);
}




void series_PrepareStyle(object sender, ChartPrepareStyleInfoEventArgs args)
{
ChartSeries series = sender as ChartSeries;
args.Style.DisplayText = true;
args.Style.TextOrientation = ChartTextOrientation.Smart;
series.Style.Font.Size = 12;
}

and set my labels :

private void chart1_ChartFormatAxisLabel(object sender, ChartFormatAxisLabelEventArgs e)
{
chart1.PrimaryXAxis.TickLabelsDrawingMode = ChartAxisTickLabelDrawingMode.AutomaticMode;
int index = (int)e.Value;
if (e.AxisOrientation == ChartOrientation.Horizontal && index < chart1.Series.Count && index > 0)
e.Label = chart1.Series[index - 1].Name;
}



When my series is more than 5 it shows XaxisLabel for odd Series and when my series is more than 10 it shows XaxisLable for 3,6,9 and when .... but i want see all my XaxisLabel.
what can i do?

smh
Replied On June 28, 2009 04:49 AM

i try 2 use usermode and write :

chart1.PrimaryXAxis.Labels.Add(new ChartAxisLabel(items[i], Color.Maroon, new Font("Arial", 9F, System.Drawing.FontStyle.Bold)));


but all of my Xaxis has shown on Serie[0];

Manimala S [Syncfusion]
Replied On June 30, 2009 09:17 AM

Hi Mahdi,

Sorry for the delay in responding.

To set custom labels for the axis ChartAxisTickLabelDrawingMode must be set as Usermode. But in the code you have given as Automaticmode. So this will not force custom labels to be displyed. I have created a sample to set custom labels for the axis. Kindly get the sample from the following link.

http://files.syncfusion.com/support/Chart.Windows/V7.2.0.20/F83927/main.htm

Kindly, let me know if you have any other queries.

Thanks,
Manimala.



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.

;