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.

Charts mislabel horizontal axis

Thread ID:

Created:

Updated:

Platform:

Replies:

119789 Jul 31,2015 09:35 AM Aug 4,2015 08:54 AM Windows Forms 3
loading
Tags: Chart
Keerthi
Asked On July 31, 2015 09:35 AM

Keerthi
Created on Jul 31, 2015 08:53 AM

Hi,

 I am new to Syncfusion. We are using Syncfusion 10.104.0.44. 

Please find the Screen1, Screen2 and Screen3 files from attachment.


Issue: Around 200 labels are displaying on X-Axis horizontally on chart. When popup the chart, the label alignment is Center only which is correctly as in Screen1. 
But when scrolling the chart from left to right sometimes the x-axis labels are correct sometimes they are incorrect. 
please watch the Screen1, Screen2 and Screen3 for tall bar 17041 . 
Sometimes it is reported as "6" it is correct label. 
Some time it is reported as "5" it is incorrect label. 
This correct/incorrect toggles for every click of the scroll left/right bar.

I want to show the all labels with center alignment as in Screen1 even while scrolling.


Info: ChartControl.LayoutCompleted event is getting triggered for every scroll click. made the PrimaryXAsis label alignment as Center in the handler even after getting same issue. 


Can any one please help me for this issue. 


Regards,
Keerthi


Attachments_d0e3497e.zip

Attachment: Attachments_4f931dc5.zip

Vinothkumar Arumugam [Syncfusion]
Replied On August 3, 2015 11:07 AM

Hi Keerthi,
Thanks for using Syncfuison control.
We have analyzed your query and found that you have assigned string for X-axis labels. So while scrolling the chart, X-Axis label are changed. For example,

In the below screen shot

we have changed the axis label 8 as “eight" on rendering the chart.


Code Snippet

CS:

if (e.Value == 8)

   e.Label = "eight";
e.Handled = true;

After zooming the chart, the range for the chart are changing based on the zoomfactor.

Screenshot


CS
chart.ZoomFactorX = 0.9;

Now see the labels of X-Axis, we don’t have 8 as visible label, so the string "eight" is not visible. But the column is drawn for 8th point only.

Likewise in your scenario, we guess that, you are changing the X-axis labels to string  based on index of visiblelabels, on changing the zoomfactor using scrollbar the visible labels are changing and string value for the labels is assigned based on new visible label index, hence you are finding the difference in xaxis label.

Please let us know, if you have any clarification.

Regards,

Sanjith K.​


Keerthi
Replied On August 4, 2015 08:02 AM

Hi Keerthi,
Thanks for using Syncfuison control.
We have analyzed your query and found that you have assigned string for X-axis labels. So while scrolling the chart, X-Axis label are changed. For example,

In the below screen shot

we have changed the axis label 8 as “eight" on rendering the chart.


Code Snippet

CS:

if (e.Value == 8)

   e.Label = "eight";
e.Handled = true;

After zooming the chart, the range for the chart are changing based on the zoomfactor.

Screenshot


CS
chart.ZoomFactorX = 0.9;

Now see the labels of X-Axis, we don’t have 8 as visible label, so the string "eight" is not visible. But the column is drawn for 8th point only.

Likewise in your scenario, we guess that, you are changing the X-axis labels to string  based on index of visiblelabels, on changing the zoomfactor using scrollbar the visible labels are changing and string value for the labels is assigned based on new visible label index, hence you are finding the difference in xaxis label.

Please let us know, if you have any clarification.

Regards,

Sanjith K.​


Hi Sanjith, 

Your guess is absolutely right. We are changing the X-axis labels to string  based on index of visiblelabels.

We are setting the value for
  chart.ZoomFactorX based on number labels count (ex: for suppose total no.of labels is 200).
Ex:

LABEL_THRESHOLD_NUMBER = 15;
NoOfLabelCount = 200; 

chart.ZoomFactorX = (LABEL_THRESHOLD_NUMBER/ NoOfLabelCount) // which is 0.075 

Here setting the value for ZoomFactorX  at the time of preparing chart and after they are not changing it till end. 
We should not modify the ZoomFactorX manually because of chart also will get change based on it.

So, how can we achieve, to show all the XAxis labels on with center alignment even while scrolling…? 

Regards,
Keerthi.


Sanjith Kesavan [Syncfusion]
Replied On August 4, 2015 08:54 AM

Hi Keerthi,
Please ignore our previous update.

By default, points in series are plotted against X and y values. When there is necessary to ignore the x-values and simply use the positional value of the point in a series, “Indexed” property is used.
Please find the following code snippet
Code Snippet
[C#]
chart.Indexed = true;

Screen shot:



We have prepared the sample as per your requirement. Please find the sample from the below location
http://www.syncfusion.com/downloads/support/directtrac/142228/ze/Lables-1710463669


Please let us know if you have any concerns

Regards,
Sanjith K


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.

;