Multiple Metric in canvas

Hi everyone ,
I am using Canvas and I want to represent top 5 of field and break it down with another field
I can simply do that in Visualization by Metric type and select Maximum of Field1 and break it down with top 5 of field 2
in Canvas I just can bring 1 metric for the maximum only ! but I want Maximum 5 also I can't break this single metric with another field

any help please

You have two options I think:

  • Save the Lens metric to the library and import it to you workpad
  • Use a table to bring the data and render it together

I did both using the eCommerce dataset rendering the average of products.base_price broken by category.keyword:

The table is rendering using the following SQL:

SELECT category.keyword as cat,
       round(avg("products.base_price"),2) as avg_price
FROM "kibana_sample_data_ecommerce"
GROUP BY category.keyword
ORDER BY category.keyword

and in markdown I render a basic table:

| Category | Average Price |
| :--      | --: |
{{#each rows}}
**{{cat}}** | **${{avg_price}}**

with the following styling:

/* hide borders */
.canvasRenderEl table,
.canvasRenderEl tr,
.canvasRenderEl td,
.canvasRenderEl td:last-child,{
  border: none;
/* hide table header*/
.canvasRenderEl thead{
  display: none;

/* change 1st column*/
.canvasRenderEl td:first-of-type{
  vertical-align: top;
  font-size: 1.2em;

/* change 2nd column*/
.canvasRenderEl td:nth-of-type(2){
  line-height: 1.5em;
  font-size: 2.5em;

Hope it helps

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