Current filter:
          You should refresh the page.
          Not Logged In

          How to show a tooltip with a series point's data

          0

          This example demonstrates how to display custom information from the underlying data source in a tooltip for every series point, using the ToolTipController component.

          See also:
          - How to show custom data over WebChartControl using ASPxPopupControl;
          - How to show series labels for hot-tracked points;
          - How to accompany a chart, its pane or series point by text or image annotations.

          You must  log in  or  register  to leave comments
          Select file
          • Form1.cs
          Select language
          • C#
          • VB.NET
          Select version
          • v2009 vol 3.2 - v2012 vol 1.2
          using System;
          using System.Data;
          using System.Windows.Forms;
          using DevExpress.XtraCharts;
          using DevExpress.Utils;
          
          namespace docShowSeriesPointTooltip {
              public partial class Form1 : Form {
                  public Form1() {
                      InitializeComponent();
                  }
          
                  private ToolTipController toolTipController1 = new ToolTipController();
          
                  private void Form1_Load(object sender, EventArgs e) {
                      // TODO: This line of code loads data into the 'nwindDataSet.Products' table. You can move, or remove it, as needed.
                      this.productsTableAdapter.Fill(this.nwindDataSet.Products);
          
                  }
          
                  private void chartControl1_ObjectHotTracked(object sender, HotTrackEventArgs e) {
                      SeriesPoint point = e.AdditionalObject as SeriesPoint;
          
                      if (point != null) {
                          DataRowView rowView = (DataRowView)point.Tag;
          
                          string s = "Unit price = " + rowView["UnitPrice"].ToString() +
                              "\r\nUnits in stock = " + rowView["UnitsInStock"].ToString() +
                              "\r\nQuantity per unit = " + rowView["QuantityPerUnit"].ToString();
                          toolTipController1.ShowHint(s);
                      }
                      else
                          toolTipController1.HideHint();
                  }
              }
          }