This is a migrated thread and some comments may be shown as answers.

RadChart-Tool Tip

1 Answer 122 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Preetam Ray
Top achievements
Rank 1
Preetam Ray asked on 10 Nov 2008, 12:33 PM
Hi,
    We are using rad-chart for our application and the chart that gets generated is dynamically generated one where in i am trying to add  tool tip for the  series item by concatneating two string values .The issue is that when i try to add a Newline definition between them i get JS error when the page loads saying "String has not been terminated".But the two string values appears one below the other as expected.PFB the code  that generates the above issue.

for

(int ic = 0; ic < dtv.Count; ic++)

 

{

ChartSeriesItem seriesItem =

new ChartSeriesItem();

 

seriesItem.YValue = (

double)dtv[ic]["Settlement"];

 

seriesItem.Name = "Settlement";

seriesItem.Appearance.Border.Color = Color.Black;

seriesItem.XValue = Convert.ToDouble(dtv[ic]["Date"]);

seriesItem.ActiveRegion.Tooltip = "Date :" + DateTime.FromOADate(Convert.ToDouble(dtv[ic]["Date"])).ToShortDateString() + "" + System.Environment.NewLine + "Price :$" + dtv[ic]["Settlement"].ToString() + "";

 

RadToolTipManager1.TargetControls.Add(

null, seriesItem.ActiveRegion.Tooltip.ToString(), true);

 

s0.AddItem(seriesItem);

}
The code has been highligted in green color.

Please let me know where i am wrong.

Thanks & Regards,
Preetam.

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 12 Nov 2008, 12:27 PM
Hi Preetam Ray,

Generally if you are integrating RadChart and RadTooltipManager it is not possible to use the RadTooltipManager.TargetControls collection. The supported options are:

  • Either use RadTooltipManager.AutoTooltipify property set to true.
  • Or set RadToolTipManager.ToolTipZoneID to the ClientID of the chart control (in order to only use RadToolTipManager for the chart) as demonstrated here.

However, you will not be able to insert new line in the displayed tooltip like this -- you can only customize the RadToolTipManager.Width property that would restrict the width for all tooltips. Note that the result you are observing on your end currently after the JavaScript error occurs is a system tooltip and not RadTooltip -- if you would like to use multiline tooltip in this scenario you would need to use system tooltips instead.

Sorry for the inconvenience.


Kind regards,
Manuel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Chart (Obsolete)
Asked by
Preetam Ray
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or