I've tried the following in Chrome console.

var jsonString = '[{"A1": "SomeStringData","A2": 5},{"B1": "SomeStringData","B2": 14}]';
var jsonObject = JSON.parse(jsonString);

which then outputs as expected


What browser are you using? I can only assume this is either a browser bug, or you're not preparing the JSON string with apostrophes at the begining and the end.


The discrete bar char is expecting the same name for labels and values:

nv.addGraph(function() {  
  var chart = nv.models.discreteBarChart()
      .x(function(d) { return d.label })
      .y(function(d) { return d.value })

So, either incorporate the expected names in your data, as such:

historicalBarChart =
    key: "SomeKey",

Or keep your names, but then change the code, making sure the names in the data are kept uniform.

Related Query

More Query from same tag