Keen.io Dataviz to draw the graph but keep getting the "Uncaught Requested parser does not exist" error

Tried doing some custom data changes before plotting the line graph

Keen.io Dataviz to draw the graph but keep getting the error "Unused query parser does not exist"

Does Keen.Dataviz only provide data from Keen.query ??

Data:

{
    "result": [
        {
            "value": 317,
            "timeframe": {
                "start": "2017-04-01T00:00:00.000Z",
                "end": "2017-05-01T00:00:00.000Z"
            }
        },
        {
            "value": 1015,
            "timeframe": {
                "start": "2017-05-01T00:00:00.000Z",
                "end": "2017-06-01T00:00:00.000Z"
            }
        }
    ],
    "totalusers": 5357
}


vm.mau = JSON.stringify(data.result, null, 2);
console.log(vm.mau);
var chart = new Keen.Dataviz()
    .el(document.getElementById('my-div'))
    .chartType("line")
    .colors(["#6ab975"])
    .title("AVG. TIME ON SITE / USER")
    .width(400)
    .prepare();

chart
    .data({result: vm.mau})
    .render();

      

+3


source to share


1 answer


You can definitely send Keen.Dataviz () data from other sources, or manually pass it.

Here are some examples: https://keen.io/docs/visualize/visualize-your-own-data/

If you click on the JavaScript JSFiddles tabs, you can see how we pass data.



I went ahead and created a JSFiddle with your example: https://jsfiddle.net/trt2yddw/1/

// Fetch data from another API or your own data source:
var data = {
    "result": [
        {
            "value": 317,
            "timeframe": {
                "start": "2017-04-01T00:00:00.000Z",
                "end": "2017-05-01T00:00:00.000Z"
            }
        },
        {
            "value": 1015,
            "timeframe": {
                "start": "2017-05-01T00:00:00.000Z",
                "end": "2017-06-01T00:00:00.000Z"
            }
        }
    ],
    "totalusers": 5357
}

var chart = new Keen.Dataviz()
    .el(document.getElementById('chart'))
    .chartType("line")
    .colors(["#6ab975"])
    .title("AVG. TIME ON SITE / USER")
    .width(400)
    .prepare();

chart
  .data(data)
  .render();

      

+5


source







All Articles