# Static Pie Chart

**URL:** https://discuss.elastic.co/t/static-pie-chart/371202
**Category:** Kibana
**Created:** [November 28, 2024, 3:07pm UTC](https://discuss.elastic.co/t/static-pie-chart/371202 "2024-11-28T15:07:24Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Hannah\_J\_Swystun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hannah_j_swystun/32/139547_2.png) [@Hannah\_J\_Swystun](https://discuss.elastic.co/u/Hannah_J_Swystun)
#### Post date: [November 28, 2024, 3:07pm UTC](https://discuss.elastic.co/t/static-pie-chart/371202/1 "2024-11-28T15:07:24Z")

</div>

Hi,  
I am using KIBANA 7.8.0 :

- Index type : app-YYYY-MM-DD which means an index is created every day
- Visualization : Pie Chart
- Data from a CSV files with logstash example :  
TIMESTAMP;APP1;PASSED;5.6  
TIMESTAMP;APP2;PASSED;3.8  
TIMESTAMP;APP3;FAILED;0  
I created a pie chart that has query DSL between : 7h00 and 07h10

```auto
{
  "range": {
    "@timestamp": {
      "gte": "now/d+7h",
      "lt": "now/d+7h+10m"
    }
  }
}

```

in dashboard section, i used default query of : TODAY to make this works fine  
Unfortunately, by adding a new pie chart which display YESTERDAY same range of time, this is not working!

```auto
{
  "range": {
    "@timestamp": {
      "gte": "now/d-1d+7h",
      "lt": "now/d-1d+7h+10m"
    }
  }
}

```

Any idea please .....why this is working for the first TODAY chart and not for YESTERDAY chart !!!

---

<div class="post-metadata">

### Author: ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)
#### Post date: [November 28, 2024, 5:53pm UTC](https://discuss.elastic.co/t/static-pie-chart/371202/2 "2024-11-28T17:53:43Z")

</div>

Hello @Hannah_J_Swystun , welcome to the community!!

Could you please execute the query via Dev Tools & confirm if you are able to see records for below query :

{  
"range": {  
"@timestamp": {  
"gte": "now/d-1d+7h",  
"lt": "now/d-1d+7h+10m"  
}  
}  
}

Thanks!!

---

<div class="post-metadata">

### Author: ![Hannah\_J\_Swystun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hannah_j_swystun/32/139547_2.png) [@Hannah\_J\_Swystun](https://discuss.elastic.co/u/Hannah_J_Swystun)
#### Post date: [November 29, 2024, 8:43am UTC](https://discuss.elastic.co/t/static-pie-chart/371202/3 "2024-11-29T08:43:21Z")

</div>

![1](https://us1.discourse-cdn.com/elastic/original/3X/f/9/f9dfcc68f7f3617b74e6f635b3d77a2f03edd194.png)

Hello,

I changed it a little bit by adding :  
query {  
}

Yes it works in dev tools, but in dashboard, it does not works for last 24h == yesterday, however, same query of today is working...  
Today : now/d+7h -\> now/d+7h10m + default query : TODAY in dashboard is working

Problem is with LAST 24h, it is very weird ....do you have any idea please ?

---

<div class="post-metadata">

### Author: ![Hannah\_J\_Swystun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hannah_j_swystun/32/139547_2.png) [@Hannah\_J\_Swystun](https://discuss.elastic.co/u/Hannah_J_Swystun)
#### Post date: [November 29, 2024, 9:12am UTC](https://discuss.elastic.co/t/static-pie-chart/371202/4 "2024-11-29T09:12:44Z")

</div>

This is a screen of TODAY which works fine, i think may be the problem is from index naming such as : index-YYYYMMDD ?

 ![2](https://us1.discourse-cdn.com/elastic/original/3X/a/4/a47f3e3c6b49d976ab1fabf4157798110047d076.png)

---

<div class="post-metadata">

### Author: ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)
#### Post date: [November 29, 2024, 9:55am UTC](https://discuss.elastic.co/t/static-pie-chart/371202/5 "2024-11-29T09:55:07Z")

</div>

Thank you for sharing the details.

But while creating the PieChart are you selecting an specific index name or it is an index pattern?

if it is an index name then you need to select index pattern as in the DevTools also the Indexpattern used is /app-selenium-\*/

Thanks!!

---

<div class="post-metadata">

### Author: ![Hannah\_J\_Swystun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hannah_j_swystun/32/139547_2.png) [@Hannah\_J\_Swystun](https://discuss.elastic.co/u/Hannah_J_Swystun)
#### Post date: [November 29, 2024, 9:59am UTC](https://discuss.elastic.co/t/static-pie-chart/371202/6 "2024-11-29T09:59:47Z")

</div>

I am selecting index-pattern which means my-index-\*  
I would like to display only DATA of yesterday from 7h00 to 7h10 so i used this query dsl :  
now/d-1d+7h to now/d-1d+7h+10m  
this range works in dev\_tools but not in query dsl ?  
that's why i though about index-YYYYMMDD which is different every day...  
please help to make my pie chart static in dashboard and not changed by date range....

May be i should separate static dashboard and dynamic dashboard ?

---

<div class="post-metadata">

### Author: ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)
#### Post date: [November 29, 2024, 11:52am UTC](https://discuss.elastic.co/t/static-pie-chart/371202/7 "2024-11-29T11:52:45Z")

</div>

> [@Tortoise](#):
>
> now/d-1d+7h+10m

Hello,

I was able to create a static lens.

Found below solution :

> [@How to dissociate a visualization from timepicker](https://discuss.elastic.co/t/how-to-dissociate-a-visualization-from-timepicker/49659/2):
>
> @apt275, there is a slightly hacky way to accomplish what you want, but maybe you can use it as a starting point. Thanks @lukas for the suggestion. So, the problem is that the timepicker will affect all visualizations that are timebased. If you want a view of your data that is independent of the timepicker, then you have two options that I can come up with. (which is the most removed from what you're asking) is to create a second dashboard that is dependent on a larger date range, and save t…

1. Created a index pattern from current index source & did not select timestamp as the field. So in discover you will only see raw data.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/2/32257b2ae0bcb79f58f2b2d3eba66c5802648989.png)

1. Once this is done , i go ahead a created a lens from this Index pattern

2. Now when adding this lens on dashboard the data remains statics irrespective of the global date picker

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/c/ac5e721eb1572b7d7e9c14fa6682f3f80f0e83ba.png)

Please check.

Thanks

---

<div class="post-metadata">

### Author: ![Hannah\_J\_Swystun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hannah_j_swystun/32/139547_2.png) [@Hannah\_J\_Swystun](https://discuss.elastic.co/u/Hannah_J_Swystun)
#### Post date: [November 29, 2024, 1:46pm UTC](https://discuss.elastic.co/t/static-pie-chart/371202/8 "2024-11-29T13:46:54Z")

</div>

I don't know how to thank you,  
Thank youuuuuuuuuuuuuuuuuuuuuu so much, it saved my life.  
did not know we can hack index-pattern with names such as :  
my-index-\*  
my-index-\*\*  
my-index-\*\*\* (may be a third alias is : NO use ^^ ) ! who knows ?

Thank you so much \<3

---

<div class="post-metadata">

### Author: ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)
#### Post date: [November 29, 2024, 2:15pm UTC](https://discuss.elastic.co/t/static-pie-chart/371202/9 "2024-11-29T14:15:38Z")

</div>

Good to know that the hack worked 🙂

---

<div class="post-metadata">

### Author: ![Hannah\_J\_Swystun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hannah_j_swystun/32/139547_2.png) [@Hannah\_J\_Swystun](https://discuss.elastic.co/u/Hannah_J_Swystun)
#### Post date: [November 29, 2024, 2:25pm UTC](https://discuss.elastic.co/t/static-pie-chart/371202/10 "2024-11-29T14:25:28Z")

</div>

my-index-\* (Dynamique Date Range)  
my-index-\*\* (Static Date Range)  
my-index-\*\*\* (what kind of third option could it be ) ?

---

<div class="post-metadata">

### Author: ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)
#### Post date: [November 29, 2024, 3:06pm UTC](https://discuss.elastic.co/t/static-pie-chart/371202/11 "2024-11-29T15:06:12Z")

</div>

\*\*\* might be for more custom use but anyhow that will not be needed as already we have an index created with & without timestamp.
