# How can I show all series data for the vega/vaga lite tooltip like tsvb

**URL:** https://discuss.elastic.co/t/how-can-i-show-all-series-data-for-the-vega-vaga-lite-tooltip-like-tsvb/252222
**Category:** Kibana
**Tags:** vega
**Created:** [October 15, 2020, 3:03pm UTC](https://discuss.elastic.co/t/how-can-i-show-all-series-data-for-the-vega-vaga-lite-tooltip-like-tsvb/252222 "2020-10-15T15:03:24Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Roy\_Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roy_zhang/32/67560_2.png) [@Roy\_Zhang](https://discuss.elastic.co/u/Roy_Zhang)
#### Post date: [October 15, 2020, 3:03pm UTC](https://discuss.elastic.co/t/how-can-i-show-all-series-data-for-the-vega-vaga-lite-tooltip-like-tsvb/252222/1 "2020-10-15T15:03:25Z")

</div>

Dear Vega/vaga lite experts,

How can I show all series data for the vega/vaga lite tooltip like tsvb (just like the following graph)?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/7/f7cde6debe334dd7561416f414e4f24300477fee.png)

Thanks for ur help in advance!

Thanks,  
Roy

---

<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: [October 15, 2020, 5:20pm UTC](https://discuss.elastic.co/t/how-can-i-show-all-series-data-for-the-vega-vaga-lite-tooltip-like-tsvb/252222/2 "2020-10-15T17:20:30Z")

</div>

Hi Roy- this is not the default behavior of Vega or Vega-Lite when using the tooltip plugin, so it will require more configuration from your side to get this. The main reason is that the tooltip plugin is operating on a single row in the data at a time, and usually each row is a single point in a series. So you basically have two options for how to make this work:

1. Use Vega transforms to copy the relevant series values onto multiple rows. This might involve using multiple datasets that you join together in some way?
2. In Vega (not Vega-Lite) you might be able to create a selection on the X axis that is able to select a dataset of multiple rows and render this as a tooltip.

This is getting into some highly custom logic though, so it will be difficult to help you other than generic advice like the kind I'm giving above.

---

<div class="post-metadata">

### Author: ![Roy\_Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roy_zhang/32/67560_2.png) [@Roy\_Zhang](https://discuss.elastic.co/u/Roy_Zhang)
#### Post date: [October 15, 2020, 11:59pm UTC](https://discuss.elastic.co/t/how-can-i-show-all-series-data-for-the-vega-vaga-lite-tooltip-like-tsvb/252222/3 "2020-10-15T23:59:44Z")

</div>

Thx Dear @wylie.

Regarding first option, yes, I am using the first option as I am using term to generate multiple series. Is there any example for the first option?

The following is my vega lite code, but the tooltip only show one series data.  
Could u pls kindly help to have a look if possible? Thanks in advance!

```auto
  transform: [
    {
      flatten: [
        my_date_histo.buckets
      ]
      as: [
        buckets
      ]
    }
  ]

  // "encoding" tells the "mark" what data to use and in what way. See https://vega.github.io/vega-lite/docs/encoding.html
  encoding: {
    x: {
      // The "key" value is the timestamp in milliseconds. Use it for X axis.
      field: buckets.key
      type: temporal
      axis: {
        title: false
      } // Customize X axis format
    }
    y: {
      // The "doc_count" is the count per bucket. Use it for Y axis.
      field: buckets.the_movfn.value
      type: quantitative
      axis: {
        title: false
      }
    }
    color: {
      field: key
      type: nominal
      title: false
    }
    tooltip: [
      /*{
        field: buckets.key
        type: temporal
        title: TimeStamp
      }*/
      {
        field: key
        type: nominal
        title: Instance
      }
      {
        field: buckets.the_movfn.value
        type: quantitative
        title: value
      }
    ]
  }
  layer: [{
    mark: area
  }, {
    mark: point

    selection: {
      pointhover: {
        type: single
        on: mouseover
        clear: mouseout
        empty: none
        fields: ["buckets.key", "key"]
        nearest: true
      }
    }

    encoding: {
      size: {
        condition: {
          selection: pointhover
          value: 100
        }
        value: 5
      }
      fill: {
        condition: {
          selection: pointhover
          value: white
        }
      }
    }
  }]
}

transform: [
    {
      flatten: [
        my_date_histo.buckets
      ]
      as: [
        buckets
      ]
    }
  ]

```

---

<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: [October 16, 2020, 2:49pm UTC](https://discuss.elastic.co/t/how-can-i-show-all-series-data-for-the-vega-vaga-lite-tooltip-like-tsvb/252222/4 "2020-10-16T14:49:45Z")

</div>

Hi Roy- like I said before, the first option is to "copy the relevant series values onto multiple rows". To give a JSON example, you would need to go from this kind of data:

```auto
[
  { x: 1, y: 100, key: 'A' },
  { x: 1, y: 200, key: 'B' },
]

```

to this:

```auto
[
  { x: 1, y: 100, key: 'A', tooltip: [{ y: 100, key: 'A' }, { y: 200, key: 'B' }] },
  { x: 1, y: 200, key: 'B', tooltip: [{ y: 100, key: 'A' }, { y: 200, key: 'B' }] },
]

```

---

<div class="post-metadata">

### Author: ![Roy\_Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roy_zhang/32/67560_2.png) [@Roy\_Zhang](https://discuss.elastic.co/u/Roy_Zhang)
#### Post date: [October 19, 2020, 4:05am UTC](https://discuss.elastic.co/t/how-can-i-show-all-series-data-for-the-vega-vaga-lite-tooltip-like-tsvb/252222/5 "2020-10-19T04:05:24Z")

</div>

Thx @wylie, let me have a check.

---

<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: [November 16, 2020, 4:05am UTC](https://discuss.elastic.co/t/how-can-i-show-all-series-data-for-the-vega-vaga-lite-tooltip-like-tsvb/252222/6 "2020-11-16T04:05:27Z")

</div>

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