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.
Syncfusion Feedback

Understanding behavior of custom chart axis labels

Thread ID:

Created:

Updated:

Platform:

Replies:

61598 May 29,2007 08:59 PM UTC May 30,2007 09:57 AM UTC Windows Forms 1
loading
Tags: Chart
Roger Norris
Asked On May 29, 2007 08:59 PM UTC

We've noticed some unexpected behavior with custom chart axis labels. We are adding several custom labels to a chart axis, but the labels do not appear on the chart past a certain value. Below is some sample code which yields similar results:

ChartControl chartControl1;
.
.
.

//Creation of New Series
ChartSeries series = chartControl1.Model.NewSeries("MySeries", ChartSeriesType.Line);
this.chartControl1.Model.Series.Add(series);

.
.
.

// Format the axis and add custom labels
ChartAxis axis = chartControl1.PrimaryXAxis;
axis.ValueType = ChartValueType.Logarithmic;
axis.RangeType = ChartAxisRangeType.Set;
axis.Range.Min = -1;
axis.Range.Max = 1;
axis.TickLabelsDrawingMode = ChartAxisTickLabelDrawingMode.UserMode;
axis.Labels.Clear();
axis.TickSize = new Size(1, 6);

for (double power = -1.0; power <= 1.0; power += 0.25)
{
ChartAxisLabel label = new ChartAxisLabel(Math.Pow(10.0, power), "0.00");
label.RoundingPlaces = 5;
axis.Labels.Add(label);
}

.
.
.

We were expecting to see nine custom chart labels, ranging from 10^-1 to 10^1. However, as shown in the attached screenshot, half of the labels do not appear on the chart. The last displayed label is 10^0, leaving off four labels (10^0.25 thru 10^1).

We can confirm that the last four labels are definitely being added to the label collection, and with the debugger we can see them inside the label collection. But for some reason the labels are not being drawn on the chart.

We'd like to know if there's a way to get all of the custom labels to appear.


ChartAxisLabels.zip

Rashidha F [Syncfusion]
Replied On May 30, 2007 09:57 AM UTC

Hi Roger,

Thanks for using Syncfusion Products.

If your intension is to create a custom axis label means please set ChartAxisValuetype as Custom. I have modified your sample.

Please take a look at the attached sample.

http://websamples.syncfusion.com/samples/Chart.Windows/F61598/main.htm

The above sample exhibit how to draw a custom labels in chart control.

Please let me know if this helps.

Regards,
Rashidha.

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.

Warning Icon 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.Close Icon

;