Skip to main content

Visual mapping

Visual mapping is a concept of using data to alter the visualization elements of a chart such as color, size and symbol.

Color By

Below is a scatter plot of palmer penguins with color specified by the species.

Loading...

Stacked bar & color by

Sometimes colorBy alone may not be sufficient. For example, creating a stacked bar but partitioning the bar further based on another dimension and coloring each partition is achieved by partitioning and coloring.

Loading...
note

Till 5.2.2 ECharts supported the ability to create a stacked bar by applying visual color on a dimension other than the category dimension used for the bar chart (see issue 16459).

Symbol By

Below is a scatter plot of palmer penguins with symbol specified by the species.

Loading...

Size By

Category Data Series

Below is a scatter plot of palmer penguins with symbol size specified by the species.

Loading...

Value Data Series

Note that the data series used for sizeBy can be either a category data series or a value data series. A value data series will result in a linear interpolation of the symbol size.

Loading...

Color Palette

It is possible to specify global color palette for all the charts using the following API. The colors argument is an array of html colors.

// for multiple colors
DataFrame.Plugin.Chart.setColorPalette(colors);

// for single color but gradient, say for heat maps
DataFrame.Plugin.Chart.setMonoColorPalette(colors);

// single color
DataFrame.Plugin.Chart.setMonoColor(color);