Getting all values from ElasticSQL in canvas

Hi, Currently i'm trying to plot a pie chart using canvas, my target is plot the percente (%) of a single column values, this is my closer aproach:

image

filters
| essql 
  query="SELECT * FROM demo_finanzas_21 WHERE contrapartes='Alan Juarez' AND divisas='USD'"
| pointseries color="ganancia" size="size(factor_ganancia)"
| pie hole=45 labels=true legend=false 
  palette={palette "#882E72" "#B178A6" "#D6C1DE" "#1965B0" "#5289C7" "#7BAFDE" "#4EB265" "#90C987" "#CAE0AB" "#F7EE55" "#F6C141" "#F1932D" "#E8601C" "#DC050C" gradient=false}
| render

If i hardcode the count value of essql as follows:

essql query="SELECT * FROM demo_finanzas_21 WHERE contrapartes='Alan Juarez' AND divisas='USD'" count=2000

I'm getting another plot:

image

Is there a way to plot this pie chart getting all values?

This is the solution:

filters
| essql 
  "SELECT COUNT(*) as conteo, ganancia FROM demo_finanzas_21 WHERE divisas='USD' AND contrapartes='Alan Juarez' GROUP BY ganancia"
| pointseries color="ganancia" size="conteo"
| pie hole=45 labels=true legend=false palette={palette "#7ECAE3" "#003A4D" gradient=true}
| render

image

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.