A
A
Al Sm2017-01-10 02:01:30
JSON
Al Sm, 2017-01-10 02:01:30

How to correct the received JSON data?

Hello. How to cast one type to another type ? Needed to build a graph.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2017-01-10
@radio_mus

Make an object, process it and again translate it into json:

var tempObject = JSON.parse(json)
var tempArray = [];
for (var i = 0; i < tempObject.values.length; i++) {
  tempArray.push([tempObject.values[i].x,tempObject.values[i].y])
}
var result = JSON.stringify(tempArray);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question