Reputation: 878
I have a webservice from which I parse data and plot bar charts. I'm using morris.js library.
Problem: I have a webservice like this:
At select query parameter, I pass the values which I want to search like:
the json response is something like below:
"hits" : {
"total" : 2,
"max_score" : 1.0,
"hits" : [ {
"_id" : "abcd",
"_score" : 1.0,
"fields" : {
"x" : [ "10" ],
"y : [ "20" ]
}
}]
}
}
When I enter x, y, z
in the select field next time, I want the bar charts to be automatically updated based on the entered fields
NOTE: I'm using _id
value to be on x-axis and whatever select values entered to be on y axis.
Upvotes: 0
Views: 417
Reputation: 878
Found solution:
Initialized morris chart with dummy values.
And then used morrisChart.setData()
method to dynamically update the chart.
Upvotes: 1