Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Problem with Custom Tooltips for individual bars on a Barchart
posted

Hello All,

I am working on a barchart, and need some urgent help displaying custom tool tips for each bar.

Bars are sorted and arranged according to certain business logic. For instance a set of bars might represent integer data, while others might represent time, and a third set may be used to represent some custom formated data.

The requirement is to show tooltips based on the nature of the bar. For example, bars that represent data need show tooltips in the format <DATA_VALUE>, bars that represent time need to tooltip data in the format <TIME_VALUE:HH:MM> and so on.

Is this possible and how would I go about implementing the above?

Any help will be much appreciated.

Lavanya

Parents
No Data
Reply
  • 26458
    Offline posted
    The tooltip can be formatted in any way you like, as long as you implement IRenderLabel.

    Here's the basic skeleton of implementing custom tooltips:
    Hashtable labelHash = new Hashtable();
    labelHash.Add(
    "CUSTOM", new LabelRenderer());
    ultraChart1.LabelHash = labelHash;
    ultraChart1.Tooltips.FormatString =
    "<CUSTOM>";

    class LabelRenderer : IRenderLabel
    {
       public string ToString(Hashtable context)
       {
          string textString = "";
          return textString;
       }
    }

    Of course, the most important part is determining what textString should be. This is where you have to analyze your data with the help from the information in the context hash table (like data row and data column).

Children
No Data