Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make tooltips show up when mouse hovers over data point
    primarykey
    data
    text
    <p>I've been searching for some sort of tutorial focusing on how tooltips to work, but have not had much luck. </p> <p>I have a test project where I render a line chart with five data points. When I instantiate the <code>Chart</code> object I set <code>IsMapEnabled = true</code>. When I define the series I try to set the tool tip.</p> <pre><code> private void DefineSeries() { var series = new Series(); series.ToolTip = "#VALY"; series.PostBackValue = "#Index"; var x = new[] {0, 1, 2, 3, 4, 5}; var y = new[] {0, 4, 5, 3, 7, 2}; for ( int i = 0; i &lt; x.Length; i++ ) { series.Points.Add( new DataPoint( x[ i ], y[ i ] ) ); } series.ChartType = SeriesChartType.Line; DefineSeriesStyle( series ); chart_.Series.Add( series ); } </code></pre> <p>The chart renders as expected, but a tooltip does not display when the mouse hovers over a data point. I am clearly missing a step somewhere, but I have no idea what it is.</p> <p><strong>EDIT:</strong> Code that shows the Action method and constructor for the chart view model and subsequent function call.</p> <pre><code> public ActionResult CausedOutPoint() { var causedOut = new CausedOutViewModel(); var path = Server.MapPath( "~" ) + "CausedOut.Png"; causedOut.Chart.SaveImage( path, ChartImageFormat.Png ); return File( path, "img/png" ); } public CausedOutViewModel() { chart_ = new Chart {IsMapEnabled = true}; chart_.PostPaint += chart__PostPaint; chart_.RenderType = RenderType.ImageMap; chart_.ID = "CausedOut"; InitializeChart( chart_ ); chart_.Width = new Unit( 1200, UnitType.Pixel ); chart_.Height = new Unit( 800, UnitType.Pixel ); CreateTitles(); } private void InitializeChart( ) { DefineSeries(); DefineChartArea(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload