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

chart tooltips are wrong (appear truncated)

Hi,

I am seeing an issue with tooltips not displaying the correct value when you hover over the series.

I have attached an example project, which is very basic. I turned on ShowToolTips. If you hover over the chart, you will notice that the value displayed is incorrect.

With some experimentation, it appears as though the last digit of the string is being truncated. For example, in my screenshot, the tooltip reads "42", but I believe the actual value is 420-something.

There are cases where tooltips do work - but in this case, they do not. Please let me know if you're able to reproduce this, and if you can provide me a fix.

Also, please do not delay any of the other chart fixes I am expecting on account of this bug.

Best regards,
BenT

4.4.0.51
VS 2005 .NET 2.0

ToolTipTruncation.zip

3 Replies

RR Ramya R Syncfusion Team April 17, 2007 07:03 AM UTC

Hi BenT,

My apologies for the delay in responding to you.

I modified the code snippet in the application sent by you as shown below and I was able to reproduce the condition that you have mentioned here.

ChartSeries series = this.chart.Model.NewSeries();
series.Points.Add(10, 100);
series.Points.Add(20, 200);
series.Points.Add(30, 300);
this.chart.Series.Add(series);
this.chart.ShowToolTips = true;

This condition occurs because in the call for Application.SetCompatibleTextRenderingDefault( ) method under Main method a false Boolean value is passed. But for the tooltips to appear completely a true Boolean value is to be passed as a parameter. So kindly change the method as below to pass a true Boolean value,

Application.SetCompatibleTextRenderingDefault(true ) ;

Let me know if you have any queries.

Thanks & Regards,
Ramya.


BT Ben Tsai April 17, 2007 05:54 PM UTC


Hi Ramya,

Changing this parameter from false to true did fix the tooltips issue. However, it has adverse effects on the rest of my application (obviously with text rendering).

Is there a way to tell the individual chartcontrol to use compatible text rendering instead of applying the change globally?

Ben

>Hi BenT,

My apologies for the delay in responding to you.

I modified the code snippet in the application sent by you as shown below and I was able to reproduce the condition that you have mentioned here.

ChartSeries series = this.chart.Model.NewSeries();
series.Points.Add(10, 100);
series.Points.Add(20, 200);
series.Points.Add(30, 300);
this.chart.Series.Add(series);
this.chart.ShowToolTips = true;

This condition occurs because in the call for Application.SetCompatibleTextRenderingDefault( ) method under Main method a false Boolean value is passed. But for the tooltips to appear completely a true Boolean value is to be passed as a parameter. So kindly change the method as below to pass a true Boolean value,

Application.SetCompatibleTextRenderingDefault(true ) ;

Let me know if you have any queries.

Thanks & Regards,
Ramya.


RR Ramya R Syncfusion Team April 19, 2007 09:47 AM UTC

Hi BenT,

My apologies for the delay in responding to you.

Currently our ChartControl does not contain the UseCompatibleTextRendering( ) Method which is used to apply TextRendering for specific Control. Could you please open a DirectTrac incident with regard to this with the Forum ID and Title of the Forum in the subject of the incident, so that we could log a bug report with regard to this issue and follow up you in the incident with the details regarding this defect.

For timebeing you can also workaround this issue using any one of two code snippets below,


1. private void Series1_PrepareStyle(object sender, ChartPrepareStyleInfoEventArgs args)
{
ChartSeries series = sender as ChartSeries;
if (series != null)
{
series.PointsToolTipFormat = String.Format("YValue = {0}", series.Points[args.Index].YValues[0]);
}
}


2. ToolTip toolTip=new ToolTip( );
private void chartControl1_ChartRegionMouseMove(object sender, Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventArgs e)
{
int i = e.Region.PointIndex;
if (e.Region.SeriesIndex == 0)
{
toolTip.Active = true;
toolTip.Show(this.chartControl1.Series[0].Points[i].YValues[0].ToString(), this.chartControl1, e.Point.X + 10, e.Point.Y + 10, 1000);
}
}

private void chartControl1_ChartRegionMouseLeave(object sender, Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventArgs e)
{
toolTip.Hide(this.chartControl1);
}

Let me know whether this helps you.

Thanks & Regards,
Ramya.

Loader.
Live Chat Icon For mobile
Up arrow icon