I'm trying to create a Canvas dashboard plotting metricbeat CPU stats, and I'm using an area chart for this:
I'd like the colour of the series to change as it goes up the Y axis from green at the bottom to red at the top (or eventually some other weighted palette).
However although I have set gradient=true it doesn't seem to affect the plot. Here's the code:
filters
| essql
query="SELECT \"system.cpu.total.pct\" * 100 AS cpu, \"@timestamp\", \"service_name\" FROM \"metricbeat-6.4.3-2019.01.09*\" WHERE \"metricset.name\"='cpu' ORDER BY \"@timestamp\" DESC"
| pointseries x="@timestamp" y="mean(cpu)"
| plot defaultStyle={seriesStyle bars=0 lines=1 points=0 fill=1} palette={palette "#D3FB71" "#7ECAE3" "#f03b20" gradient=true}
| render
and the SQL query for the data source:
SELECT "system.cpu.total.pct" * 100 AS cpu, "@timestamp", "service_name" FROM "metricbeat-6.4.3-2019.01.09*" WHERE "metricset.name"='cpu' ORDER BY "@timestamp" DESC
edit: applied the correct gradient