Select to view content in your preferred language

Display a line chart in the popup window for aggregated representation ( Binning )

05-23-2023 02:53 AM
New Contributor II

Hello everyone, In the following example, we will discuss aggregated representation :

Suppose we have a Date field in our initial layer. Is it possible to have a histogram displayed when we click on a rectangle, showing the monthly evolution?

Thanks for your help.

Tags (3)
0 Kudos
3 Replies
Esri Regular Contributor

Yes. This is possible. You need to query the features within the bin and create a column chart representing however you partition the data. This sample demonstrates how to query features inside a bin using Arcade: 

In the popup, click one of the arrows next to the pie chart to see a similar visualization using a line chart. This chart displays the number of crimes that occurred in each month within the bin.


This blog also steps you through the process: 

0 Kudos
New Contributor II

Hello @KristianEkenes ,
Thank you for your response. I tried to follow the same methodology, particularly to retrieve the data reported in January with the code below, but it gives me an error. Do you have any idea where the problem might come from?


                  type: "expression",
                  // lists the top 5 most common fuel types in the bin
                  expressionInfo: {
                  expression: `
                    Expects($aggregatedFeatures, "DATE_HEURE")
                    var monthStats = Count(Filter($aggregatedFeatures, "DATE_HEURE > Date(2023-05-01)" ))
                    return {
                    type: "text",
                    text : monthStats
0 Kudos
Esri Regular Contributor

Yeah, I see the issue, but it's a bit of a confusing one... It's in the where clause of the Filter function. That where statement is a SQL where, and doesn't allow Arcade functions. So this bit: 

"DATE_HEURE > Date(2023-05-01)"

Needs to change to:

"DATE_HEURE > '2023-05-01'"


Then it should work...

Here's an example: 


0 Kudos