I am novice with billboard.js, tried to do a very simple thing: changing the color of a line.
var chart = bb.generate({
data: {
columns: [
["data1", 30, 20, 50, 40, 60, 50],
["data2", 200, 130, 90, 240, 130, 220]
],
type: "line",
bindto: "#dataColor"
});
chart.data.colors({data1:'orange'});
In this example, I can change the color of data1 in orange, but data1 is not a variable, I want something like this:
var lab1="toto",lab2="titi";
var chart = bb.generate({
data: {
columns: [
[lab1, 30, 20, 50, 40, 60, 50],
[lab2, 200, 130, 90, 240, 130, 220]
],
type: "line",
bindto: "#dataColor"
});
chart.data.colors({lab1:'orange'});
But this doesn't work, I have to hard code the value of lab1: chart.data.colors({toto:'orange'})