> ## Documentation Index
> Fetch the complete documentation index at: https://cubed3-igor-docs-cartesian-chart-builder.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Color & legend

> Configure color palettes, custom palettes, and legend placement for charts.

Every chart type draws its colors from a palette, and most draw a legend naming what each color
means. This page covers the palettes themselves and the **Legend** section of the Style tab.

Where colors are assigned differs by chart type. On a bar, line, area, or scatter chart, each measure
carries its own **Palette** or **Color** control in its
[axis section](/docs/explore-analyze/charts/configuration/axes#measure-appearance) of the Style tab, and
what a color stands for is decided by that measure's
[break-down](/docs/explore-analyze/charts/configuration/fields#break-down-by) on the Fields tab. Pie,
funnel, sankey, heatmap, and map charts each carry a single **Palette** dropdown of their own — but
the palettes are the same ones below.

## Color scales

Breaking a measure down by a dimension creates one series per distinct value of that dimension, each
taking a color from the active palette. The dimension's type decides which palettes are offered:

| Data type                  | Palette options                                          |
| -------------------------- | -------------------------------------------------------- |
| **String / nominal**       | Discrete palettes (one color per category value)         |
| **Date / temporal**        | Discrete (nominal) or continuous (temporal gradient)     |
| **Numeric / quantitative** | Discrete (nominal) or continuous (quantitative gradient) |

For strings, only discrete bucketing is available. For dates and numbers, you can choose whether each
value gets its own distinct color (discrete) or a gradient is applied across the range (continuous).
If a date or numeric field only offers discrete options, try casting the field to the appropriate
type.

A measure with no break-down is drawn as a single series in one color, picked automatically as the
next palette color after every break-down's values so it never collides with them. Set it explicitly
with the **Color** swatch in that measure's row.

Two measures broken down by the same dimension share its color scale: the same value is the same
color in both, and a palette change on either applies to both. Each measure still keeps its own
legend row.

## Palettes

### Discrete palettes

For discrete data, colors from the palette are applied in palette order, matching the sort order of
the query results. Change the palette order by adjusting the sort in your query.

Enable **Reverse colors** to reverse the order colors are applied.

### Continuous (gradient) palettes

For continuous data, the gradient palette maps to the range of values in your results. Select a
different gradient from the palette dropdown to change the color treatment.

### Custom palettes

If none of the provided palettes fit your needs, you can build a custom palette for an individual
chart:

1. Open the palette control on the Style tab.
2. Select the last option in the palette menu: **Custom palette**.
3. Click **Customize** to open the palette editor.
4. Add, remove, and edit individual hex colors.
5. Use **Open hex code editor** to toggle a bulk editor and paste a comma-separated list of hex
   values.

To reuse a custom palette across charts, copy the hex codes and paste them into the custom palette
editor of another chart.

## Legend

The **Legend** section at the bottom of the Style tab configures the chart's legend:

| Option          | Description                                           |
| --------------- | ----------------------------------------------------- |
| **Visibility**  | Show or hide the legend                               |
| **Orientation** | **Right** (default), **Left**, **Top**, or **Bottom** |

On a bar, line, area, or scatter chart, each measure gets its own legend row titled with the measure
name: a broken-down measure lists its values, a measure with no break-down shows its symbol alone.
Clicking an entry hides only that measure's series, so a value shared by two measures' break-downs is
hidden where you clicked it and left alone in the other legend.

Other chart types decide for themselves whether a legend starts on: a pie carries one regardless, a
funnel starts without one, and a sankey has none to configure.
