Customize the "Number of Features" Label text for a layer with clustering

504
2
Jump to solution
04-28-2022 09:53 AM
Labels (1)
RobertoRossi
Occasional Contributor

In Map Viewer I have a point layer with Clustering Enabled.

The legend shows a Number of features description.

immagine.png

How can I customize the "Number of features" text?

I supposed it should be possible from the Clustering > Clustering Label > Label Field, and then working with Arcade, but I'm not able

RobertoRossi_0-1651164379802.png

RobertoRossi_0-1651164777659.png

 

 

This is the Arcade code I have if I chose the </> button:

$feature["cluster_count"];
var value = $feature["cluster_count"];
var num = Count(Text(Round(value)));
var label = When(
num < 4, Text(value, "#.#"),
num == 4, Text(value / Pow(10, 3), "#.0k"),
num <= 6, Text(value / Pow(10, 3), "#k"),
num == 7, Text(value / Pow(10, 6), "#.0m"),
num > 7, Text(value / Pow(10, 6), "#m"),
Text(value, "#,###")
);
return label;

Is there a way to obtain a customized text?

0 Kudos
1 Solution

Accepted Solutions
3raan
by
New Contributor III

In the Cluster menu, select the "Cluster fields" button.

3raan_0-1651167655423.png

Then, select the "Number of features" field and rename. 

3raan_2-1651167792998.png

 

View solution in original post

2 Replies
3raan
by
New Contributor III

In the Cluster menu, select the "Cluster fields" button.

3raan_0-1651167655423.png

Then, select the "Number of features" field and rename. 

3raan_2-1651167792998.png

 

RobertoRossi
Occasional Contributor

Thank you very much @3raan for the solution!

simpler than I thought

Roberto