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.

Trackball Label not displayed when chart has only one data point

Thread ID:

Created:

Updated:

Platform:

Replies:

128956 Feb 17,2017 08:44 AM Feb 23,2017 07:33 AM WPF 7
loading
Tags: SfChart
Maurizio Taddei
Asked On February 17, 2017 08:44 AM

Hi,

Please find attached sample solution. 

I have added a trackball behavior and customized the trackball label via template and everything is working fine. The only problem is that the label is not displayed when there is only one data point (as you can see from the sample solution). If you uncomment the additional data points in the window's code-behind, you will notice that the trackball label displays as expected. Why is this happening and is there any way around it?

Also, would it be possible to display the trackball label from the data grid? 
As you can see from the sample solution, when you mouse-over the grid rows, it will highlight the associated point on the chart. This is great, but I was wondering if I could also trigger/display the trackball label for the point.

Thanks,
Maurizio

Attachment: Testing_WFP_Charts_fd8f3038.rar

Santhiya Arulsamy [Syncfusion]
Replied On February 20, 2017 08:32 AM

Hi Maurizio, 
 
Thanks for contacting Syncfusion Support. 
 
Currently, we are analyzing your requirement. We will update you the status on 21st February, 2017. 
 
Thanks, 
Santhiya A 


Devi Aruna Maharasi Murugan [Syncfusion]
Replied On February 21, 2017 12:39 PM

Hi Maurizio, 
  
Query 1: label is not displayed when there is only one data point 
  
For continuous series (such as Line, Spline, FastLine ), the trackball label will be displayed for more than one data points and it is the default behavior of trackball. So, to display the trackball label for single data point, we need to add one more data point (dummy data point with YValue null or double.NaN). 
  
Query 2: would it be possible to display the trackball label from the data grid? 
  
We have achieved this requirement with custom trackball behavior. We have modified the provided sample and it can be downloaded from below link, 
  
  
Regards, 
Devi 
 


Maurizio Taddei
Replied On February 22, 2017 05:56 AM

Hi Santhiya,

that is brilliant, thanks very much!

Unfortunately I have stumbled upon another issue which I do not understand:

Basically, the trackball label does not display in specific circumstances. Please see the attached sample solution. 
As you can see, the label for "SAMPLE_0001" and "SAMPLE_0002" are not being displayed. 

However, if you set the "SampleResult" for "SAMPLE_0001" to 5, then it displays fine. 
Also,  if you set the "Date" for "SAMPLE_0002" to commented value, then it also displays fine.

Any idea why this is happening?

Regards,
Maurizio

Attachment: Testing_WFP_Charts_dff27663.rar

Maurizio Taddei
Replied On February 22, 2017 06:28 AM

Hi Santhiya,

that is brilliant, thanks very much!

Unfortunately I have stumbled upon another issue which I do not understand:

Basically, the trackball label does not display in specific circumstances. Please see the attached sample solution. 
As you can see, the label for "SAMPLE_0001" and "SAMPLE_0002" are not being displayed. 

However, if you set the "SampleResult" for "SAMPLE_0001" to 5, then it displays fine. 
Also,  if you set the "Date" for "SAMPLE_0002" to commented value, then it also displays fine.

Any idea why this is happening?

Regards,
Maurizio

Attachment: Testing_WFP_Charts_dff27663.rar

Hi,

I just noticed that if the Trackball LabelDisplayMode is set to FloatAllPoints, then the labels are displayed, but this is not my desired behavior.

Regards,
Maurizio

Maurizio Taddei
Replied On February 22, 2017 11:39 AM

Hi,

Also noticed that if I remove the RangeAreaSeries, then it works fine.

Regards,
Maurizio

Maurizio Taddei
Replied On February 23, 2017 04:22 AM

Hi,

I have fixed my problem. I fixed it by overriding the GenerateLabels method of my CustomTrackball. Basically I remove all unwanted points (e.g. RangeArea points) before handing over to the base method. Please find solution attached.

        protected override void GenerateLabels()
        {
            var pointsToRemove = new Collection<ChartPointInfo>();
            foreach (ChartPointInfo pointInfo in this.PointInfos)
            {
                if (pointInfo.Item is ChartDataItem) continue;
                pointsToRemove.Add(pointInfo);
            }

            foreach (var pointInfo in pointsToRemove)
                this.PointInfos.Remove(pointInfo);

            base.GenerateLabels();
        }

Regards,
Maurizio

Attachment: Testing_WFP_Charts_57c2cbc8.rar

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On February 23, 2017 07:33 AM

Hi Maurizio, 
  
Thanks for your update. 
  
We glad that your problem has been resolved. Please let us know, if you need any further assistance on this. 
  
Regards, 
Devi 
 


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.

;