How to show tooltip using SeriesMapping

17 posts, 1 answers
  1. Jabson
    Jabson avatar
    3 posts
    Member since:
    Jun 2009

    Posted 15 Jun 2009 Link to this post

    Hi,
    I am trying to show the tooltip using SeriesMapping, but nothing appears, I am using the following code:

    var

     

    q7 = from info in q00 

     

     

                  group info by info.OkAtendimento into tt 

     

                  select new KeyValuePair<string, decimal?>((bool)tt.Key ? "Sim" : "NÆo", tt.Sum(info => info.ValorAtual / 1000));  

     

     

     


    this
    .radChart.SeriesMappings.Clear();

     

    seriesMapping.SeriesDefinition =

    new BarSeriesDefinition();  

     

    seriesMapping.LegendLabel =

    "Valor ($/1000)"

     

     

    itemMappingValue.FieldName =

    "Value";  

     

     

    itemMappingValue.DataPointMember =

    DataPointMember.YValue;

     

     

     

    seriesMapping.ItemMappings.Add(itemMappingKey);

    seriesMapping.ItemMappings.Add(itemMappingValue);

    seriesMapping.SeriesDefinition.ShowItemToolTips =

    true;  

    this
    .radChart.SeriesMappings.Add(seriesMapping); 
    this.radChart.ItemsSource = q7.ToList(); 
    this.radChart.DefaultView.ChartArea.AxisX.TickPoints.Clear();

    foreach
    (KeyValuePair<string, decimal?> label in q7.ToList()) 
    {
                this.radChart.DefaultView.ChartArea.AxisX.TickPoints.Add(new TickPoint() { Label = label.Key }); 
    }

     

     

    thanks!

    Jabson

     

     

  2. Answer
    Ves
    Admin
    Ves avatar
    2879 posts

    Posted 17 Jun 2009 Link to this post

    Hi Jabson,

    I have attached a small example, based on your code, where the tooltips appear as expected. Still, I am not really sure about the itemMappingKey in your code, so I just commented out the only line that mentions it. In addition you can add a formatting to the tooltip:

    seriesMapping.SeriesDefinition.ToolTipFormat = "C0";

    or take advantage of ItemToolTipOpening event as shown in this example.

    Best regards,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
  4. Monalisa
    Monalisa avatar
    35 posts
    Member since:
    May 2009

    Posted 24 Sep 2009 Link to this post

    HI,

    I did the same way that you shown here in the radcharttooltip.zip file, but here in tooltip only the Y-axis value is coming not X-axis value. I need both X and Y axis value in tooltip. How to do this, please suggest.

    Regards,
    Monalisa
  5. Kingsley Magnus-Eweka
    Kingsley Magnus-Eweka avatar
    54 posts
    Member since:
    Aug 2009

    Posted 28 Sep 2009 Link to this post

    Hi,
    actually you are right the Tooltip does work for a seriesMapping i just tested the code you attached to jabson and it even works when i change the chart type to a PieSeriesDefinition so my question is how do you make it work for their 3D  counterParts?
    for example in my code I am using a Pie3DSeriesDefinition()
    how come this  line :

    seriesMapping_Ref_Spend_Cat1.SeriesDefinition.ShowItemToolTips = true;

    does not work is this by desing or is there something different you have to do when using 3D charts?

    thanks

    here is my code:

    #region Sample PieChart 1

                        rct3DPieChartSpendByRef.DefaultView.ChartTitle.Content = "Top Suppliers";

     

                        //needed for the 3D zoom & interactivity out-of-the-box

                        rct3DPieChartSpendByRef.DefaultView.ChartArea.Extensions.Add(new CameraExtension());

     

                            #region series Mapping 1

                            //specify series Mapping 1 Properties

                            seriesMapping_Ref_Spend_Cat1 = new SeriesMapping();

                            seriesMapping_Ref_Spend_Cat1.LegendLabel = "Sales (Thousands)";

                            seriesMapping_Ref_Spend_Cat1.SeriesDefinition = new Pie3DSeriesDefinition();  //BarSeriesDefinition();

                            

    seriesMapping_Ref_Spend_Cat1.SeriesDefinition.LegendDisplayMode = LegendDisplayMode.None;

                            seriesMapping_Ref_Spend_Cat1.SeriesDefinition.ShowItemLabels = false;                       

     

                            //specify ItemMapping Properties

                            itemMapping_Ref_Spend_Cat1 = new ItemMapping("PercentStrVal", DataPointMember.YValue);  

                           

                            seriesMapping_Ref_Spend_Cat1.ItemMappings.Add(itemMapping_Ref_Spend_Cat1);

                            seriesMapping_Ref_Spend_Cat1.SeriesDefinition.ShowItemToolTips = true;

     

                            //Specify RadChart Overiding Properties

                            rct3DPieChartSpendByRef.SeriesMappings.Add(seriesMapping_Ref_Spend_Cat1);

                           

                             rct3DPieChartSpendByRef.DefaultView.ChartLegend.Visibility = Visibility.Visible;

                            #endregion

     

     

                     //Bind

                     rct3DPieChartSpendByRef.ItemsSource = GTopSuppliers;

     

                    #endregion

     

     

     

     

     

     

     

     

     

     

     

     

  6. Kingsley Magnus-Eweka
    Kingsley Magnus-Eweka avatar
    54 posts
    Member since:
    Aug 2009

    Posted 28 Sep 2009 Link to this post

    Hi,
    is it possible to Have 2 SeriesMappings each with its own itemMapping and have one series mapping display a PieSeriesDefinition chart and the other SeriesMapping display the Legend items of my Pie Chart?
    i seem to be able to do this using the 3D counterpart which is Pie3DSeriesDefinition() but this does not work for the 2D pie why is this can someone explain, cos its seems like i am going a bout this the wrong way trying to switch my 3D pie to a 2D...specifically i cant see to display the Legend items either i just get a default "item 0, item 1, item 2, item 3, item 4, ...." or the Legend items are not displayed at all! all the examples just show the default Legend  items but not tied to any data i have tied mine  but nothing happens can someone put a code example up in doing this properly using DataBinding: Manual SeriesMapping please...not the default that is easy
    by the way here is my Code:

    #region Sample PieChart 1

                        rct3DPieChartSpendByRef.DefaultView.ChartTitle.Content = "Top Suppliers";

     

                        //needed for the 3D zoom & interactivity out-of-the-box

                        rct3DPieChartSpendByRef.DefaultView.ChartArea.Extensions.Add(new CameraExtension());

     

                        rct3DPieChartSpendByRef.SeriesMappings.Clear();

     

                            #region series Mapping 1

                            //specify series Mapping 1 Properties - Displayes the PieChart

                            seriesMapping_Ref_Spend_Cat1 = new SeriesMapping();

                            seriesMapping_Ref_Spend_Cat1.LegendLabel = "Sales (Thousands)";

                            seriesMapping_Ref_Spend_Cat1.SeriesDefinition = new PieSeriesDefinition(); //Pie3DSeriesDefinition

                            seriesMapping_Ref_Spend_Cat1.SeriesDefinition.LegendDisplayMode = LegendDisplayMode.None;

                            seriesMapping_Ref_Spend_Cat1.SeriesDefinition.ShowItemLabels = true;                       

     

                            //specify ItemMapping Properties

                            itemMapping_Ref_Spend_Cat1 = new ItemMapping("PercentStrVal", DataPointMember.YValue);  

                           

                            seriesMapping_Ref_Spend_Cat1.ItemMappings.Add(itemMapping_Ref_Spend_Cat1);

                            seriesMapping_Ref_Spend_Cat1.SeriesDefinition.ShowItemToolTips = true;

     

                            //Specify RadChart Overiding Properties

                            rct3DPieChartSpendByRef.SeriesMappings.Add(seriesMapping_Ref_Spend_Cat1);

                           

                            //controls showing the Pie Legend ites which is its Series Mapping 2

                            rct3DPieChartSpendByRef.DefaultView.ChartLegend.Visibility = Visibility.Visible;

                            #endregion

                           

                            #region series Mapping 2

                            //specify series Mapping 2 Properties –Displays the Legend Items for the pieChart works for 3D

                            seriesMapping_Supplier_Name_Cat1 = new SeriesMapping();

                            seriesMapping_Supplier_Name_Cat1.LegendLabel = "Sales (Thousands)2";

                            seriesMapping_Supplier_Name_Cat1.SeriesDefinition = PieSeriesDefinition(); //Pie3DSeriesDefinition

                            //seriesMapping_Supplier_Name_Cat1.SeriesDefinition.DefaultLabelFormat = "NO";

     

                            //specify ItemMapping Properties

                            itemMapping_Supplier_Name_Cat1 = new ItemMapping("Legend_Value", DataPointMember.LegendLabel); 

                            seriesMapping_Supplier_Name_Cat1.ItemMappings.Add(itemMapping_Supplier_Name_Cat1);

     

                           

                            rct3DPieChartSpendByRef.SeriesMappings.Add(seriesMapping_Supplier_Name_Cat1);

                            #endregion

     

                     //Bind

                     rct3DPieChartSpendByRef.ItemsSource = GTopSuppliers;

     

                    #endregion



    thanks

    Kingsley Magnus-Eweka
  7. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 29 Sep 2009 Link to this post

    Hi Monalisa,

    I have attached another page where XCategory is used for axis labels and in the tooltips.

    Kind regards,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 29 Sep 2009 Link to this post

    Kingsley,

    Actually, one SeriesMapping object is intended to serve one DataSeries. You can add many ItemMappings, which will define the content of the different elements of the items:

    SeriesMapping seriesMapping_Ref_Spend_Cat1 = new SeriesMapping(); 
                seriesMapping_Ref_Spend_Cat1.LegendLabel = "Sales (Thousands)"
                seriesMapping_Ref_Spend_Cat1.SeriesDefinition = new PieSeriesDefinition();  
                seriesMapping_Ref_Spend_Cat1.SeriesDefinition.LegendDisplayMode = LegendDisplayMode.DataPointLabel; 
                seriesMapping_Ref_Spend_Cat1.SeriesDefinition.ShowItemLabels = true
     
                ItemMapping itemMapping_Ref_Spend_Cat1 = new ItemMapping("Value", DataPointMember.YValue); 
                seriesMapping_Ref_Spend_Cat1.ItemMappings.Add(itemMapping_Ref_Spend_Cat1); 
                seriesMapping_Ref_Spend_Cat1.SeriesDefinition.ShowItemToolTips = true
     
                itemMapping_Ref_Spend_Cat1 = new ItemMapping("Key", DataPointMember.LegendLabel); 
                seriesMapping_Ref_Spend_Cat1.ItemMappings.Add(itemMapping_Ref_Spend_Cat1); 

    I have attached an example as well.

    All the best,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. Kingsley Magnus-Eweka
    Kingsley Magnus-Eweka avatar
    54 posts
    Member since:
    Aug 2009

    Posted 29 Sep 2009 Link to this post

    Vers Thank you very much,
    this is a fantasitic example, and works beautifully, if only it was available in your documentation or the Examples, I know you guys are pretty busy creating amazing controls but i dont mind updating you documentation so that this will take unnessary load of your support and people can ask the really difficult questions or what they dont understand, i am quite serious...if you need someone to update each control in the documentation with straight forward samples like this one you provided i am quite happy to do it, as you can see this SeriesMapping example is not that clear for people doing this the first time in the documentation but thank you very much! keep up the good work
    Kingsley
  10. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 01 Oct 2009 Link to this post

    Hello Kingsley,

    Thanks for the feedback and for your willingness to help. I can assure you that we are working hard on our documentation and with Q3 we plan to drastically improve and enrich our help content.

    Best regards,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  11. Walter Mesquita
    Walter Mesquita avatar
    5 posts
    Member since:
    Feb 2010

    Posted 18 Feb 2010 Link to this post

    Ves,
    is there a way to get 3D charts to show tooltips?

    I've tried to do it through the ItemToolTipFormat property and by using the ItemDataBound event (and setting the DataPoint's tooltip). But it only works for regular series definitions. It does not work with the 3D ones.

    Best Regards,
    Walter
  12. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 19 Feb 2010 Link to this post

    Hi Walter,

    I am afraid RadChart for Silverlight does not support tooltips for the 3D types.  Please, accept our apologies for the inconvenience caused by this limitation.

    Sincerely,
    Ves
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  13. Walter Mesquita
    Walter Mesquita avatar
    5 posts
    Member since:
    Feb 2010

    Posted 19 Feb 2010 Link to this post

    Ves,
    thanks for your response. Are you planning to implement this feature in future releases?

    Walter
  14. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 24 Feb 2010 Link to this post

    Hello Walter,

    I am afraid this would not be possible with our current implementation and the current version of the Silverlight framework. As the framework evolves and new features are added, we will review our implementation and check if this can be improved. Unfortunately, there is nothing certain for the moment, so we cannot provide any time frame for this.

    Kind regards,
    Ves
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  15. Anitha
    Anitha avatar
    33 posts
    Member since:
    Apr 2012

    Posted 02 Jul 2012 Link to this post

    Hi All,

           I am able to get the tooltip for the series, but the problem is I want the tooltip, only when I put my mouse on the datapoint.
    I am able to get the tooltip where ever i keep my mouse point on the series(line).

    Thanks in Advance, 
  16. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 02 Jul 2012 Link to this post

    Hi Anitha,

    It sounds like you are asking for a Trackball-like functionality rather than the ToolTip feature. If you use RadChartView instead of RadChart you can achieve the functionality you are looking for.

    The new RadChartView offers much more than the older RadChart. This link will bring you to the side by side comparison of the two different controls. RadChartView can still provides you with the ability to use ToolTips.

    This link will bring you to the demo of RadChartView where you can explore the different features it provides.

    Good Luck,
    Lancelot
  17. Anitha
    Anitha avatar
    33 posts
    Member since:
    Apr 2012

    Posted 03 Jul 2012 Link to this post

    Thanks Lancelot.

    My total chart is developed using Radchart, now I can't change it to RadchartView.
    Is there any way to show tooltip value only at the datapoint using Radchart.

    Thanks
  18. Evgenia
    Admin
    Evgenia avatar
    1406 posts

    Posted 04 Jul 2012 Link to this post

    Hi Anitha,

    This has already been discussed in the other forum thread you asked  the same question.
    Since I've seen that you asked us in several posts for one and the same thing - please consider avoiding duplicate threads. This makes it harder for both sides to follow the conversation and floods the threads.

    Regards,
    Evgenia
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top
DevCraft banner