Answer the question
In order to leave comments, you need to log in
Two-dimensional JavaScript array or how to drive data?
In a loop, I pull data from JSON
for( ...) {
mas_days[i] = json_parse[i]. date;
mas_res[i] = "{meta:'1', val:1"}";
}
After that, they need to be inserted into the chart
var chart = new Chartist.Line('.ct-chart1', {
labels: mas_days,
series: [
[
{meta: 'Date 1', value: 1},
{meta: 'Date 2', value: 5},
{meta: 'Date 3', value: 3}
]
]
}, {
plugins: [ Chartist.plugins .tooltip() ],
height:200
});
And instead
of series: [
[
{meta: 'date 1', value: 1},
{meta: '
{meta: 'Date 3', value: 3}
]
]
I need to insert a two-dimensional array, but I can't figure out how to do it :(
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question