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. Image for the cookie policy date
close icon

Trackball Label not displayed when chart has only one data point

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

7 Replies

SA Santhiya Arulsamy Syncfusion Team February 20, 2017 01:32 PM UTC

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 



DA Devi Aruna Maharasi Murugan Syncfusion Team February 21, 2017 05:39 PM UTC

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 
 



MT Maurizio Taddei February 22, 2017 10:56 AM UTC

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


MT Maurizio Taddei replied to Maurizio Taddei February 22, 2017 11:28 AM UTC

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


MT Maurizio Taddei February 22, 2017 04:39 PM UTC

Hi,

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

Regards,
Maurizio


MT Maurizio Taddei February 23, 2017 09:22 AM UTC

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


DA Devi Aruna Maharasi Murugan Syncfusion Team February 23, 2017 12:33 PM UTC

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 
 


Loader.
Live Chat Icon For mobile
Up arrow icon