I have a situation to bind a json data with a key to plot a graph. But graph is plotting correctly but the name of the data is showing the same key. i need to avoid it .
How can i supply a name for my data. I have tried as follows but its seems not working. Can any guys help one this.
data: {
// columns: [chartData],
json: data,
keys: {
value: [key]
},
type: chartType,
labels: true,
selection: {
enabled: false
},
names: {
data1: 'Some Name'
}
}
Thanks in Advance :) Kiran Gopal
答案 0 :(得分:1)
您应该替换变量data1
的值,而不是key
。或者您可以构造名称值,如此
var names = {}
names[key] = 'Some Name';
var chart = c3.generate({
...
names: names
},
});