# Representation of Flow sequences in a Pie Chart

**URL:** <https://discuss.elastic.co/t/representation-of-flow-sequences-in-a-pie-chart/66703>\
**Category:** Kibana\
**Created:** [November 21, 2016, 11:14am UTC](https://discuss.elastic.co/t/representation-of-flow-sequences-in-a-pie-chart/66703 "2016-11-21T11:14:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hicham\_Mouddi](https://avatars.discourse-cdn.com/v4/letter/h/8e8cbc/32.png) [@Hicham\_Mouddi](https://discuss.elastic.co/u/Hicham_Mouddi)\
**Post date:** [November 21, 2016, 11:14am UTC](https://discuss.elastic.co/t/representation-of-flow-sequences-in-a-pie-chart/66703/1 "2016-11-21T11:14:46Z")

</div>

Hello,

I am new in using Kibana, and I would like to visualise a temporal sequence of actions in a PieChart.

Context : :  
Each time a user receive a notification on his smartphone, I collect the log (user\_id, timestamp, name of the notification), and I want to know the temporal sequence of received notifications aggregated per users.

EX : The first level of the pie chart shows slices that represents the notification which has been sent first to the user . Each size of the slice represents the percentage of unique users who received that notification first.  
Then the 2nd level of the pie chart represents the percentage of users who received the notification after the first one ....

See image below :  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/e/e0e80cf8414401b4e8b53515c36cde8cc5243a5c.PNG)

Level 1 : 25% of the users have received in the first instance the Notification A  
25% of the users have received in the first instance the Notification B  
25% of the users have received in the first instance the Notification C  
25% of the users have received in the first instance the Notification D

Level 2 :  
For those who received the notification A firstly :  
- 50 % received the notification B after  
- 50 % received the notification C after

Etc ....

If someone knows how to represent it on Kibana, I would be very grateful.

Thanks in advance,

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [November 22, 2016, 11:24pm UTC](https://discuss.elastic.co/t/representation-of-flow-sequences-in-a-pie-chart/66703/2 "2016-11-22T23:24:50Z")

</div>

I'm not sure this is possible in Kibana, but let me ask, how are you storing this data? Are these all single documents in Elasticsearch, with just a user, notification type, and time? If so, then it's definitely not going to be possible.

I think you could probably get the data you're looking for using pipeline aggregations, but Kibana doesn't have support for those at the moment.

For this to work in Kibana, you'd need to keep track of the events in a single record, in separate columns. For example, something like this:

```auto
time | user_id | notif_1 | notif_2 | notif_3 | notif_4
xxx | 1 | A | B | C | D
xxx | 2 | C | B | |  
xxx | 5 | D | A | C | 
xxx | 1 | E | B | D | A
xxx | 8 | B | | |  

```

Not ideal, since you'll need to write custom application logic to manage this and store it correctly. But without that, you can't add different buckets to your aggregations and get those different levels on the pie chart.

---

<div class="post-metadata">

**Author:** ![Hicham\_Mouddi](https://avatars.discourse-cdn.com/v4/letter/h/8e8cbc/32.png) [@Hicham\_Mouddi](https://discuss.elastic.co/u/Hicham_Mouddi)\
**Post date:** [November 23, 2016, 9:09am UTC](https://discuss.elastic.co/t/representation-of-flow-sequences-in-a-pie-chart/66703/3 "2016-11-23T09:09:13Z")

</div>

Dear Fleming,

Thanks for your answer and the details given. Actually, the datas are stored as follow :

**Time, UserId, Notification**  
xxx, User1, Notification\_welcome  
xxx, User1, Notification\_lunch  
xxx, User2, Notification\_welcome  
xxx, User2, Notification\_game  
xxx, User2, Notification\_lunch

If I follow my logic, I should order by time the sequence of notifications received and aggregate by user.  
It should give us something like that :

**UserId, Notification1, Notification2, Notification3, ....**  
User1, Notification\_welcome, Notification\_lunch  
User2, Notification\_welcome, Notification\_game, Notification\_lunch

But I don't know, how to implement it with the dev tools.

This is for datas transformation. For the Vizualisation, I found some kibana plugins that could be suitable such as : Sankey Plugin or Sunburst plugin (that does what I want to do with the piechart).

Thanks

---

<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:** [December 21, 2016, 9:09am UTC](https://discuss.elastic.co/t/representation-of-flow-sequences-in-a-pie-chart/66703/4 "2016-12-21T09:09:18Z")

</div>

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