javascript - NVD3 Cumulative line chart displays wrong y values -


I have converted a line chart to the cumulative line chart and its y values ​​are not displayed properly. The Y axis range should be 80.00 - 140.00 but instead I get -0.08 - 0.20. Has anyone managed to work with all types of categories under its normalization code? {'Y': (lines.y () (point, point index) - v) / (1 + v)}; Return point;})

Any help will be greatly appreciated.

I know that this question is some old, but I believe that the normalization code for the cumulative line Chart is not conceptual right; In addition, the NVD 3 cumulative line chart implementation is actually an index chart implementation (), I think it would be more like a cumulative line chart, I think. Cumulative charts can easily be achieved using the NVD3 line chart and some quick modifications in the underlying data.

If we take Bostoncan correctly, and we really want to get the indexed line chart, then the indexed function in NVD3 should be changed:

  / * index Making data normal by the point * / Function index (idx, data) {if (! IndexifyYGetter) indexifyYGetter = lines.y (); Return data.map (function (line, i) {if (Line.values) {return line;} var indexValue = line.values ​​[idx]; if (indexValue == null) {return line;} var v = IndexifyYGetter (IndexValue, idx); // TODO: Implement the check below, and disable the chain, if Series 1 is divided by 1, then ((Math.abs (v) & lt; 1e-6) Amp; amp;; no! // PS You may have to set a high threshold (~ 1e-6?) // I do not know that I did not run any tests ... line.tempDisabled = True; return line;} line.tempDisabled = false; line.values ​​= line.product.map (funk Return point;} return line;}}}    {index} Pre> 

I asked the authors of NVD3 and planned to submit a bridge request. Note that the percentage change chart is actually only meaningful when all the underlying data is positive when you mix negative Start throwing values, then change percentages Loses sense.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -