I have an array named "dataset" where each entry is an object with a key and value attribute, such as the following:
dataset=
[
{"key":"alpha", "value": [ {}, { } ...]},
{"key":"beta", "value": [ { }, { } ...]},
{"key":"gamma", "value": [ {}, { } ...]},
{"key":"delta", "value": [ { }, { } ...]}
];
dataset.domain:[];
dataset.query:[];
dataset.range:[];
I am working with D3.JS and I am using this dataset to plot in an stacked area chart the alpha, beta, gamma, and delta values. How can I use color.domain() to assign a different color to each "key"?
{}..., so the total structure is an array of objects, each of which contains a key name and a value sub-array.