I'm currently facing an issue with customizing the colors of my line graph created from JSON data retrieved from a URL. Below is the code snippet I'm using to generate the chart:
var chart = c3.generate({
bindto: '#chart',
data: {
url: '../URL.JSON',
mimeType: 'json',
keys: {
x: 'Date',
value: ["Line1", "Line2", "Line3", "Line4"]
},
type: 'line'
},
axis: {
x: {
type: 'category'
}
},
size: {
height: 500
},
colors: {
'Line1': '#ff0000'
}
});
Here's the format of my JSON data:
[
{'Date': '9/23/2014', 'Line1': 12, 'Line2': 54, 'Line3': 23, 'Line4': 5},
{'Date': '9/22/2014', 'Line1': 56, 'Line2': 18, 'Line3': 25, 'Line4': 0}
]
Despite setting the color for Line1 in the code above, it doesn't seem to reflect on the generated graph. Can anyone provide insights on how to modify the colors for a dynamically loaded c3 graph via URL?
Appreciate any help.