The layer in this sample is rendered with a relationship renderer, also known as a bivariate choropleth visualization, which classifies two numeric variables in either 2, 3, or 4 classes along separate color ramps. One of those ramps is rotated 90 degrees and overlaid on the other to create a 2x2, 3x3, or 4x4 square grid. The x-axis indicates the range of values for one variable, and the y-axis indicates the range for the second variable. The squares running diagonal from the lower left corner to the upper right corner indicate features where the two variables may be related or in agreement with one another.

The lower right and upper left corners indicate features where one field has high values and the other field low values and vice versa.

Keep in mind that even if you observe a positive relationship between the two variables of interest, it doesn't mean they are statistically correlated. It also doesn't imply the presence of one variable influences the other. Therefore, this renderer should be used judiciously with some prior knowledge that two variables may likely be related.

This particular visualization uses a 2x2 grid to show the potential relationship between the percentage of voters who voted for the challenger and the unemployment rate. The breakpoint between both classes in each variable is described in the image below.

While the numbers are useful, and provide context, it may be more desireable to describe each corner of the legend with simple text since some of the map readers may not know what range is considered high or low for a particular variable. Therefore providing the option to switch labels on the legend may be useful depending on the audience.

Technically, the relationship renderer is a UniqueValueRenderer instance driven by values returned from an Arcade expression. Therefore, you can alter the legend text by changing the label property in each uniqueValueInfo object. We'll use the min and max values for each class to label the axes of the legend when the option to display numbers is selected by the user. The authoringInfo property of the layer provides us with that information.

The function in the snippet below uses the information in the authoringInfo to display the range of each variable instead of descriptive text. If descriptive text is desired, then the text is swapped in favor of the numbers.