Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

Tooltip for box chart

Last post 03-24-2008 4:31 by [Infragistics] Teodor Taushanov. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-22-2008 9:47

    • seidelge
    • Not Ranked
    • Joined on 11-17-2007
    • Points 35

    Tooltip for box chart

    Hi,

    I want to show the median value of a boxchart when I move the cursor over the chart (with tooltip). Even better would be all values (max,thirdQuantil,median,firstQuantil,min) seperated by comma. I only get the max value (in your running sample you display the min value as tooltip, I have also seen a version of your running sample with the median value).

    part of my code:

    System.Data.DataTable chartData = new System.Data.DataTable();

    chartData.Columns.AddRange(new DataColumn[ { new DataColumn("Name", typeof (string)), new DataColumn("max", typeof (double)), new DataColumn("thirdQuantil", typeof (double)), new DataColumn("median", typeof (double)), new DataColumn("firstQuantil", typeof (double)), new DataColumn("min", typeof (double)), });

    .......

    chartData.Rows.Add(description, median.Max, median.ThirdQuantil, median.MedianValue, median.FirstQuantil, median.Min);

    .......

    ucProcessBoxPlot.Data.DataSource = chartData;

    ucProcessBoxPlot.Data.DataBind();

    ......

    ucProcessBoxPlot.Tooltips.Display = TooltipDisplay.MouseMove;

    ucProcessBoxPlot.Tooltips.FormatString = "DATA_VALUE:0.#";

    ucProcessBoxPlot.Tooltips.Format = TooltipStyle.DataValue;

    Thank's for any hint...

    Best Regards Georg
    • Post Points: 35
  • 03-22-2008 12:06 In reply to

    Re: Tooltip for box chart

    When trying to customize any label in the chart you will want to work with the respective FormatString property whether it is axis labels or tooltips.  There are some default format strings you can use that are listed here:

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/Chart_Use_Predefined_and_Custom_Label_Styles.html

    If a default format string will not suffice, then you will have to write a class that implements the IRenderLabel interface.  This interface has one method that you are to implement, ToString.  This method is passed a hastable that contains information for a given string that is currently being drawn.  Here is a more detailed explanation in the help:

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/Chart_Customize_Labels_Using_the_IRenderLabel_Interface.html

    Here is a sample from our Knowledge Base:

    http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=2807

    This is a WinForms sample but the same applies for both our win and web charts.  Notice that a DataTable that the chart is bound to is passed into the class that implements IRenderLabel.  Sometimes this is necessary, if the context hashtable does not contain the information you need to formulate your new string.  You can then work off values such as the row and column to figure out what what string you want to return from your DataTable.

    Filed under: ,
    • Post Points: 5
  • 03-24-2008 4:31 In reply to

    Re: Tooltip for box chart

    In this article you can read how to customize the labels:

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/Chart_Label_Formatting.html

    For the boxchart you can show all data values with:

    this.UltraChart1.Tooltips.FormatString = "<DATA_VALUE_MIN>, <DATA_VALUE_MAX>, <DATA_VALUE_Q1>, <DATA_VALUE_Q2>, <DATA_VALUE_Q3>";

    Best regards,
    Teodor Taushanov
    • Post Points: 5
Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems