# Supports Canvas Linechart the feature seriesAgg and Group this by Terms

**URL:** <https://discuss.elastic.co/t/supports-canvas-linechart-the-feature-seriesagg-and-group-this-by-terms/274650>\
**Category:** Kibana\
**Created:** [June 1, 2021, 2:30pm UTC](https://discuss.elastic.co/t/supports-canvas-linechart-the-feature-seriesagg-and-group-this-by-terms/274650 "2021-06-01T14:30:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![miri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miri/32/76789_2.png) [@miri](https://discuss.elastic.co/u/miri)\
**Post date:** [June 1, 2021, 2:30pm UTC](https://discuss.elastic.co/t/supports-canvas-linechart-the-feature-seriesagg-and-group-this-by-terms/274650/1 "2021-06-01T14:30:45Z")

</div>

Is it possible to use in Canvas Linechart the Aggregation **seriesAgg** and Group this **by Terms** like available in normal TSVB Visualisation?

# Example:

There are some servers sending status information to elasticsearch:

```auto
    //1sec
    webserver_status {type="nginx.v1", state="online"} 1
    webserver_status {type="nginx.v2", state ="online"} 2
    webserver_status {type="nginx.v1", state ="offline"} 10
    webserver_status {type="nginx.v2", state ="offline"} 10

    //5sec later
    webserver_status {type="nginx.v1", state="online"} 5
    webserver_status {type="nginx.v2", state ="online"} 6
    webserver_status {type="nginx.v1", state ="offline"} 6
    webserver_status {type="nginx.v2", state ="offline"} 6

```

Inside an normal dashboard I can create a time-visualization of servers in state online with the following Kibana UI, which works perfect:

 ![worksfine](https://us1.discourse-cdn.com/elastic/original/3X/9/f/9f63142ae1b9af4b730cb75f8b61a8f170b6be00.jpeg)

Inside Canvas Linechart there is a **aggTerms** but there is no matching documentation available, how to use this …

 ![missing](https://us1.discourse-cdn.com/elastic/original/3X/b/5/b58a83a91d583a76d6a04d65e1a6e1ac8220d378.jpeg)

means to get from my example above a Canvas line chart (similar to the TSVB visualization).  
Note: I will not include the TSVB visualization in Canvas, because in TSVB there is no way to hide x and y. This is much more Comfortable in Canvas8)

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [June 1, 2021, 6:47pm UTC](https://discuss.elastic.co/t/supports-canvas-linechart-the-feature-seriesagg-and-group-this-by-terms/274650/2 "2021-06-01T18:47:52Z")

</div>

You are probably looking for the `ply` function which is able to perform math on a column. For example `| ply by="project" fn={math "mean(price)" | as "price"}`. You would run the ply after SQL.

I do not recommend using the `agg` functions in Canvas unless you are willing to read through the source code of Kibana, as these functions are implementation details of Lens and the aggregation-based visualizations.

---

<div class="post-metadata">

**Author:** ![miri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miri/32/76789_2.png) [@miri](https://discuss.elastic.co/u/miri)\
**Post date:** [June 2, 2021, 9:28am UTC](https://discuss.elastic.co/t/supports-canvas-linechart-the-feature-seriesagg-and-group-this-by-terms/274650/3 "2021-06-02T09:28:29Z")

</div>

Got your point. I will go with **ply** , but additionally dig a bit into the source code.

---

<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:** [June 30, 2021, 9:29am UTC](https://discuss.elastic.co/t/supports-canvas-linechart-the-feature-seriesagg-and-group-this-by-terms/274650/4 "2021-06-30T09:29:17Z")

</div>

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