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

Line chart - Unable to show X-Axis labels

Thread ID:

Created:

Updated:

Platform:

Replies:

83312 Jun 24,2009 03:50 PM UTC Jun 25,2009 09:13 AM UTC WPF 1
loading
Tags: Chart
Hemanth Javali
Asked On June 24, 2009 03:50 PM UTC

Hi,
I am using syncfusion essential Chart to show a line graph. However the chart doesn't show the labels on my x-axis at any time when label source is specified. Following is a code snippet.

XAML:




LabelForeground="Black"
IntersectAction="Rotate"
Header="Wavelengths"
LabelsSource="{Binding Path=Wavelengths}"/>



RangePadding="Additional"
IntersectAction="Hide"
Header="Intensities"
LabelFontSize="10"/>




I add the chart series in the code behind as follows:

private void AddSeries()
{
float[] spectrum = Presenter.GetSpectraAt(sp.Row,sp.Column);
if (spectrum == null)
return;

Syncfusion.Windows.Chart.ChartSeries spectrumSeries = new Syncfusion.Windows.Chart.ChartSeries(Syncfusion.Windows.Chart.ChartTypes.Line);
spectrumSeries.DataSource = spectrum;
spectrumSeries.MouseClick += new Syncfusion.Windows.Chart.ChartMouseEventHandler(spectrumSeries_MouseClick);
spectrumSeries.MouseDown += new Syncfusion.Windows.Chart.ChartMouseEventHandler(spectrumSeries_MouseDown);

chartArea.Series.Add(spectrumSeries);
}

The series is displayed fine, also Y axis displays the values at specified intervals. However, I do not see any labels on X-axis. If I do not specify the LabelSource in the XAML, Labels from 0 onwards are displayed on X-axis.

Administrator [Syncfusion]
Replied On June 25, 2009 09:13 AM UTC

Hi Hemanth,

Thanks for using Syncfusion Products.

Seems like you have specified the source from which the labels are to be taken alone. We should also specify the positionpath (where to place the labels) and contentpath (which labels to place).

Code snippet provided below shows this


Attached sample illustrates this behavior.

Please refer to our online documentation from the below given link that illustrates more about Chart axis label customization
http://help.syncfusion.com/ug_72_new/chartwpf/CustomizingLabelText.html

Please let us know if you have further queries.

Thank you,
K. Saradha Devi




ChartSample_df1d2e45.zip

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

;