c# - How to make tooltips show up when mouse hovers over data point -


i've been searching sort of tutorial focusing on how tooltips work, have not had luck.

i have test project render line chart 5 data points. when instantiate chart object set ismapenabled = true. when define series try set tool tip.

  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};      ( int = 0; < x.length; i++ ) {          series.points.add( new datapoint( x[ ], y[ ] ) );      }      series.charttype = seriescharttype.line;      defineseriesstyle( series );      chart_.series.add( series );      } 

the chart renders expected, tooltip not display when mouse hovers on data point. missing step somewhere, have no idea is.

edit: code shows action method , constructor chart view model , subsequent function call.

  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();   } 

you doing in defineseriesstyle disables tooltips. have tested method without statement defineseriesstyle( series ); , tooltips shown.

for comprehensive overview on tooltips, custom tooltips refer previous answer similar question. show tooltip in lineseries winforms chart?


Comments

  1. Casino in Maha, OK - Mapyro
    Find Casino in 과천 출장샵 Maha, OK from 11:00 의왕 출장샵 a.m. to 3:00 거제 출장마사지 p.m. Find Casinos in 화성 출장마사지 Maha, OK near Casino Drive, Maha. 서산 출장마사지

    ReplyDelete

Post a Comment

Popular posts from this blog

ruby on rails - Is it the correct way to implement belongs_to relation with factory girl? -

geolocation - Windows Phone 8 - Keeping background location tracking active beyond four hours -

Uncaught TypeError: Cannot read property 'parentNode' of null javascript -