Dataset в highcharts из JSON
Здравствуйте.
У меня есть JSON вида { "FailedCount":[{"FailedCount_MEAS_VALUE":1,"DATETIME_CURRENT":"12:01"}, {"FailedCount_MEAS_VALUE":0,"DATETIME_CURRENT":"12:02"}, {"FailedCount_MEAS_VALUE":3,"DATETIME_CURRENT":"12:03"}, {"FailedCount_MEAS_VALUE":4,"DATETIME_CURRENT":"12:04"}], "SucceededCount":[{"SucceededCount_MEAS_VALUE":110}, {"SucceededCount_MEAS_VALUE":120}, {"SucceededCount_MEAS_VALUE":130}, {"SucceededCount_MEAS_VALUE":140}], "AllCount":[{"AllCount_MEAS_VALUE":121}, {"AllCount_MEAS_VALUE":120}, {"AllCount_MEAS_VALUE":133}, {"AllCount_MEAS_VALUE":144}] } каким образом на основании этого JSON постоить график highcharts, а именно передать значения AllCount в series: [ { name: 'AllCount', data: [<<from JSON>>] } $('#container').highcharts({ chart: { zoomType: 'x' }, title: { text: 'Test' }, xAxis: { categories: ["12:01","12:02","12:03","12:04"] }, yAxis: { title: { text: '' } }, legend: { enabled: true }, plotOptions: { area: { fillColor: { linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1}, stops: [ [0, Highcharts.getOptions().colors[0]], [1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')] ] }, marker: { radius: 2 }, lineWidth: 1, states: { hover: { lineWidth: 1 } }, threshold: null } }, series: [ { name: 'AllCount', data: [<<from JSON>>] } ] }); }); |
drno-reg,
Json = Json.AllCount.map(function(key) { return key["AllCount_MEAS_VALUE"] }); |
благодарю за помощь
|
Часовой пояс GMT +3, время: 17:43. |