I have this in my code:-
var chartOptions = {
series: {
bars: { show: true }
}
};
Is there a way I could add another item to the chartOptions object through code so that it was added an item to the series part, like this:-
series: {
bars: {show: true, fillColor="Red"}
}
How would I go about doing this? I was expecting something like:-
chartOptions["series"]["bars"]["fillColor"] = "Red"
But that doesn’t work. I’m pretty new to this so any help would be greatly appreciated.
Matt
You can add it inline by using
:instead of=Or you can add it in code using
jQuery.extend()or with JavaScript:Your code
chartOptions["series"]["bars"]["fillColor"] = "Red"should also work but it is the notation when dealing with arrays. The dot notation is usually used when dealing with objects. Both notations are mostly interchangeable though.