1. Simon Cross
  2. distri

Commits

Simon Cross  committed 7390491

Move dimple chart creation inside plot.init.

  • Participants
  • Parent commits 647ca7c
  • Branches default

Comments (0)

Files changed (1)

File lib/stats.js

View file
  • Ignore whitespace
             var svg = d3.select(opts.chart).append("svg")
                 .attr("width", 800)
                 .attr("height", 400);
-            var chart = new dimple.chart(svg, []);
             var plot = distri.plots.all[$select.val()];
             plot.init({
-                chart: chart,
                 svg: svg,
                 coeffs: opts.coeffs,
                 chart_title: opts.chart_title,
         all[name] = self;
 
         self.init = function(opts) {
-            self.chart = opts.chart;
             self.svg = opts.svg;
+            self.chart = new dimple.chart(self.svg, []);
             self.setup_chart_title(opts.chart_title);
             self.setup_chart_footer(opts.chart_footer);
             self.setup_chart(self.chart);