# Kibana Canvas

**URL:** https://discuss.elastic.co/t/kibana-canvas/245572
**Category:** Kibana
**Tags:** canvas
**Created:** [August 19, 2020, 9:42am UTC](https://discuss.elastic.co/t/kibana-canvas/245572 "2020-08-19T09:42:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![oliverlucas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oliverlucas/32/75353_2.png) [@oliverlucas](https://discuss.elastic.co/u/oliverlucas)
#### Post date: [August 19, 2020, 9:42am UTC](https://discuss.elastic.co/t/kibana-canvas/245572/1 "2020-08-19T09:42:12Z")

</div>

Hi All,

Trying to find some help and guidance. I'm new to Canvas (2 days) and I can already see the infinite possibilities to make some really cool stuff, but I'm really struggling.

So first off I had problems with SQL and the data from SQL but I think I've mostly cracked that now, but In addition to this, I found the Canvas Functions and trying to tackle that!

So, one of the thing's i'm trying to do is:

- Create a visualisation to display status codes from websites e.g. 2xx, 3xx, 4xx and 5xx in a progress bar as a percentage of traffic with a dynamic MAXIMUM based on the total amount of requests. e.g. If I have 10000 requests, and 8000 (80%) were 2xx and 2000 (20%) were 5xx I'd want the gauge to read 20% etc. and display the progress value relative to the total amount of codes.

My main problems are:

- How do I set a dynamic maximum, as i cant set the limit of say 10000000 as the gauge will show no data so I want the max to be the sum of all requests.

- How do i set the gauge to be % rather than SUM?

My query so far..

```auto
 filters
| essql
query="SELECT response.status AS status, count (*) AS count FROM \"myindex-*\" GROUP BY status"
| math "count"
| progress shape="gauge"
font={font family="Calibri" size=24 align="center" color="#152d6d" weight="normal" underline=false italic=false} max=1000000 valueColor="#609833" valueWeight=20
| render

```

Any help much appreciated - There doesn't seem to be much info out there in the internet TBH so I know i'm pushing my luck!

Thanks

Oliver

---

<div class="post-metadata">

### Author: ![myasonik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/myasonik/32/62369_2.png) [@myasonik](https://discuss.elastic.co/u/myasonik)
#### Post date: [August 20, 2020, 10:06pm UTC](https://discuss.elastic.co/t/kibana-canvas/245572/2 "2020-08-20T22:06:21Z")

</div>

Hey @oliverlucas!

Have you seen our [canvas function reference](https://www.elastic.co/guide/en/kibana/current/canvas-function-reference.html)?

There's an example for [fromatnumber](https://www.elastic.co/guide/en/kibana/current/canvas-function-reference.html#formatnumber_fn) which shows you how to set the gauge to show a % and I think renders a really similar graph to yours without explicitly defining a max and instead doing it with math.

If you do still need to define an explicit max value, the example for [escount](https://www.elastic.co/guide/en/kibana/current/canvas-function-reference.html#escount_fn) shows how to set the max value to a function (`escount` isn't important here, it just is the example we want).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 17, 2020, 10:06pm UTC](https://discuss.elastic.co/t/kibana-canvas/245572/3 "2020-09-17T22:06:30Z")

</div>

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