I am new here, Is it possible to have Bar or Pie chart dataset source from the API result set?
Yes that is definitely possible. In your chart you’ll have to edit the values field here:
It takes an array of numbers. So if your API call is called query1
and it returns an array of numbers you should be able to just write {{query1.data}}
in the values field. If your API call does not return an array of numbers, you could write some Javascript in Retool to quickly transform the data. What does your API call return?
Done. but the bar in the chart doesn’t show. My API call return is json.
and from json, i put in the table…
Done! I am using bulk insert. wow you guys great! thank youuuuu!
not yet the bar chart
So the bar chart needs to take an array of numbers – you need to either pick out the array of numbers from your json object or run some javascript over the json object to construct the array of numbers – does that make sense?
@taylor In that screenshot, {{score_conversion.data.conversion_score}}
would return “453”. Is that what you were looking for?
@Taylor try {{score_conversion.data[0].conversion_score}}
, I missed that it was inside an array of one
@taylor Did that work for you?
Yes, thanks. Looks like the color editor for pie charts isn’t working–it is working on other chart types. I’m using the standalone pie chart option, but it didn’t work in the charts beta either.