score:1

Accepted answer

Instead of data1, you should substitute the value of the variable key. Or you could construct the names value, like so

var names = {}
names[key] = 'Some Name'; 
var chart = c3.generate({
    ...
    names: names
  },
});

Fiddle - http://jsfiddle.net/Ld2apq0g/


Related Query