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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Column Series X-Axis Labels - Only shows every other label

Thread ID:





95020 Jun 16,2010 07:49 PM UTC Jun 18,2010 10:46 AM UTC Silverlight 4
Tags: Chart
john simmons
Asked On June 16, 2010 07:49 PM UTC

Column series is only showing every other label for the data points on the X-Axis. If I put a Line series on the same chart (with no other changes to the chart), I get all the labels on the X-Axis.

Murugavel P [Syncfusion]
Replied On June 17, 2010 09:06 AM UTC

Hi John,

Thanks for choosing Syncfusion products.

Chart axis ranges are calculated based on the series types. Column series requires an additional value to be added to the range values, so that the series will not be hidden. But Line series doesn't require these additional range values. This is the reason for this change in axis range values.

To disable this label changes, you can initialize the RangeCalculationMode property of Chart axis as AdjustAcrossChartTypes. So that all chart types add the additional range values.

The following code demonstrates how to disable this label changes in both XAML and C#.



chart.Areas[0].PrimaryAxis.RangeCalculationMode = RangeCalculationMode.ConsistentAcrossChartTypes;

Please let us know if you have any questions about this.


john simmons
Replied On June 17, 2010 02:08 PM UTC

Before I tell you the result of your suggestion, here's what I am doing:

The chart legend is configured to show the show/hide checkboxes.

I add a column chart series
I add a line chart series

When the chart is rendered, The X-Axis labels show every other data point label, starting at the 2nd data point. If I hide the column series, ALL of the labels are displayed. If I then hide the line series and re-show the column series, the labels revert to showing every other one.

I added those property settings you provided, and:

I still only see every other datapoint label, but when I hide the column series, I STILL only get every other label.

For grins, I set RangeCalculationMode="ConsistentAcrossChartTypes", and:

The chart now displays all datapoint labels for the column series and the line series, but the column series extends to the edges of the chart which results in the columns at the end being clipped.

I think this is a bug in your code.

john simmons
Replied On June 17, 2010 03:12 PM UTC

I've attached a Word document that contains my code, XAML, and screenshots of what I'm seeing.


Murugavel P [Syncfusion]
Replied On June 18, 2010 10:46 AM UTC

Hi Jhon,

Thanks for choosing Syncfusion products.

You can display every labels of Chart based on the IsAutoSetRange property of Chart axis control.

If IsAutoSetRange property of Chart axis as True then axis labels interval are calculated based on the desired interval count. In the following lines of code, the DesiredIntervalsCount property is used to initialize the number of axis labels need to be display on the Chart.

mainChart.Areas[0].PrimaryAxis.IsAutoSetRange = true;

//The DesiredIntervalsCount property is used to determine number of labels need to be display in Chart
mainChart.Areas[0].PrimaryAxis.DesiredIntervalsCount = data.Count;
mainChart.Areas[0].PrimaryAxis.RangeCalculationMode = SFChart.RangeCalculationMode.AdjustAcrossChartTypes;

If IsAutoSetRange property of Chart axis as False then you can manually initialize the Range values based on the series data count and set Interval as 1.

mainChart.Areas[0].PrimaryAxis.IsAutoSetRange = false;
mainChart.Areas[0].PrimaryAxis.Range = new Syncfusion.Windows.Chart.DoubleRange(0, data.Count + 1);
mainChart.Areas[0].PrimaryAxis.Interval = 1;

I have modified the sample based on your requirement. Here with I have attached the updated sample.

Please let me know if you have any queries.




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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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