areski / django-nvd3

Django wrapper for nvd3 - It's time for beautiful charts
Other
416 stars 124 forks source link

Uncaught TypeError: Cannot read property 'y' of undefined on tooltip in piechart #45

Closed lgp171188 closed 9 years ago

lgp171188 commented 9 years ago

Using django-nvd3 version 0.7.7 this is issue is there, but not there in 0.7.4

lgp171188 commented 9 years ago

The error is happening on the line "var y = String(graph.point.y);" of the generated JavaScript code

  chart.tooltipContent(function(key, y, e, graph) {
      var x = String(key);
          var y = String(graph.point.y);

          tooltip_str = '<center><b>'+x+'</b></center>' + y;
          return tooltip_str;
          });
chrissmejia commented 9 years ago

Same problem here.

portante commented 9 years ago

Could this be related to: https://github.com/nvd3-community/nvd3/issues/28

lgp171188 commented 9 years ago

Can no longer see this issue on upgrading to django-nvd3 0.8.2 and modifying the code as per the demoproject django application. So closing this.

AndreMiras commented 8 years ago

But then why not updating the readme accordingly? Updating chartdata in views.py with the following fixed it for me:

extra_serie = {
    "tooltip": {"y_start": "", "y_end": " cal"},
}
chartdata = {'x': xdata, 'y1': ydata, 'extra1': extra_serie}