Graphs

v2.0.0

Our graphs provide beautiful, simple, and accessible ways to understand sets of data.

  • Skin
  • CoreUI
  • React

Considerations

Keep it simple

Progressive disclosure is key—ensure you are using data visualization as a tool to aid in understanding, not to overwhelm users with too much information all at once.

Tell a story

Focus on what you want to communicate and who you’re communicating to. Understanding data is much easier when there is a human narrative. Think about how you would tell the story in a sentence.

Scale thoughtfully

Our charts scale seamlessly for all screen sizes and users. Use designated colors, interactive states, and scaling behaviors to ensure they are simple and accessible in all contexts.

Anatomy

A stacked bar chart various aspects called out using pointers. Number 1 points to the chart title. Number 2 points to the tab set. Number 3 points to gray horizontal scaffolding lines. Number 4 points to the x-axis labels. Number 5 points to the key which contains small color swatches. Number 6 points to controls in teh top right. Number 7 points to y-axis labels. Number 8 points to the bottom baseline’s horizontal line.
  1. Title
  2. Tab set
  3. Scaffolding
  4. X-axis
  5. Key
  6. Controls
  7. Y-axis
  8. Baseline

Graphs

Stacked bar chart with 6 bars. Each bar has 3 values.

Stacked bar chart

Used to compare multiple part-to-whole relationships or ranking a single data set.

Side-by-side bar chart values. Each values has 3 bars.

Side-by-side bar chart

Used to compare data across categories or two or more criteria.

Stacked area chart with 3 values.

Stacked area chart

Used to visualize a total over time and how each category contributes to the whole.

Line graph with 3 values. Each line is a different color. The first value is blue with circles, the second is teal with triangles, the third is navy blue with squares.

Line graph

Used to track changes over time for single or multiple data sets. Line graphs are better at showing smaller changes and/or longer time periods than bar charts.

Horizontal an circular progress bars with light gray background indicating the total amount and a blue to signal amount completed.

Progress bar

Used to show progress toward a single goal or total. Can be either linear or circular.

Donut chart with 3 segmented values. One value is bright blue, one value is navy blue and one value is light blue with bright blue outline and stripes.

Donut chart

Used to show the breakdown of a single part-to-whole relationship within a total.

Types

Single data sets

We use our primary blue when visualizing a single value, such as progress bars, or a single data set, like line graphs, bar charts, or area charts.

Three examples of different single data graphs. From left to right is progress bar, line, and bar graphs.

Part-to-whole data sets

We use shades of blue, and teal when needed, to represent part-to-whole relationships. This approach keeps the focus on a single, neutral color family, avoiding the use of hues like green and red that may carry specific meanings in other contexts.

Three examples of different part-to-whole graphs. From left to right is donut, stacked area, and bar graphs.

Content

Titles

Titles are critical for describing the graph and telling its story. They can summarize the type of data and its time period in a sentence, state the category in a few words and let controls dictate the time period, or highlight the takeaway as a total. You can also utilize subtitles to describe the graph title or tell the story in human language.

A line graph with a title at the top.

Title only

A line graph with a title and subtitle at the top.

Title and subtitle

A line graph with a label of “Impressions” at the top with a large number “26.3k” as the primary metric.

Primary metric

Controls

Controls can change time period, type of data, or amount of data shown on the graph. They can be tabs, quick filters or dropdowns that are either left aligned or right aligned depending on your layout and use case.

A bar chart with tabs at the top left.

Tabs

A bar chart with quick filters at the top left.

Quick filters

A bar chart with a dropdown in the top right.

Dropdown

Axis

The X and Y axes anchor the user, helping them compare data points consistently across graphs. Use clear, concise intervals that avoid overcrowding. For instance, even if the chart covers a full year with daily data, it’s unnecessary to display all 365 days on the X-axis. Ensure labels have at least 16px of space between them and include key anchor points. For example, start the Y-axis at 0 for accurate proportions and mark significant time points on the X-axis, like financial quarters or days of the week. Users can interact with the graph to view specific data points via tooltips between labels.

A stacked area chart with a title in the upper left and dropdown in the upper right. X-axis points to the labels across the bottom of the graph, as well as the marker in the middle of the graph. The marker in the middle of the graph has 3 data points and one of the data points has triggered a tooltip. Y-axis points to the labels moving up the right side.

Interactivity

Interactivity is crucial in maintaining our principles of simplicity and progressive disclosure. Graphs and charts should be simple enough to be understood at-a-glance. Progressive disclosure allows users to easily find the details they need by interacting with specific parts of the graph.

Mouse devices

On web, users can hover or click a specific point in time to see more details. This will open a tooltip above the selected time period and all other shapes on the graph fade to 30% opacity.

A desktop design with a large bar chart. A pointer cursor hovers over a bar and a tooltip appears above.

Touch devices

On mobile devices, users can interact with graphs through tap and long press gestures. A tap reveals the tooltip for a specific time period, and a second tap dismisses it. Alternatively, a long press reveals the tooltip, allowing users to scroll left or right while pressing to view each time period consecutively.

A mobile screen with a tap indicator selecting a bar within a bar chart. A tooltip appears above the selected bar.

Tool tips

Make sure the ordering of data sets in the tooltip reflects the order of the segments on the graph from top to bottom. For example, the top segment should be the top value in the flyout, the second value should be the second segment down, etc. The key under the graph should be in the opposite order since the key represents building the segments from the bottom up to the top.

A mobile screen with a tap indicator selecting a bar with multiple data points in a bar chart. A tooltip appears above the selected bar.

Density

Small screen

The size and number of bars in a bar chart can affect its clarity and meaning when the chart becomes too complex. If bars are narrower than 12px with less than 8px of padding, the chart starts to resemble an area chart, making the bars difficult to read. Aim to keep bars between 12px and 16px wide, with at least 8px of padding between them for optimal readability.

A bar chart containing 4 bars. There is 40px of padding between bars.

16px bars with 40px padding

A bar chart containing 6 bars. There is 32px of padding between bars.

16px bars with 32px padding

A bar chart containing 12 bars. There is 8px of padding between bars.

16px bars with 8px padding

Medium and Large screen

On medium and large screens, the increased real estate allows us to expand the X-axis to display more data in most graphs, often extending the time period and adding more bars in bar charts. However, if consistency in the time period across screen sizes is crucial for the user, you can maintain the same time period and instead adjust the bar width, spacing, and graph inset. On larger screens, bars can widen from 12px to 24px, with at least 8px of padding between them.

The same bar chart displayed across small, medium and large screens. As the screen size gets wider, the bars also get wider with more space in between.

Maintain time frame

Increase bar width, padding, and inset.

A bar chart displayed across small, medium and large screens. As the screen size gets wider, the bars increase in amount, and bar width and padding also become wider.

Increase time frame

Increase number of bars, width, and padding.

Color

Data viz color tokens

All of the colors we use in our data visualization patterns have been vetted for accessibility and fit into three categories: trends, charts, and line graphs. You can find the colors we use throughout this page in Color Tokens.

A table of semantic color and hex values.

Examples

Desktop screen showing eBay Selling Performance page which has a series of links in a left hand nav, a summary bar with 4 metrics across the top under the page title “Sales”, and a stacked bar chart underneath showing “Total sales”.
Three mobile screens. The first has a donut chart. The second has metrics tiles and a stacked area chart. The third has a top metric and a line graph.

Best practices

Axis

Do separate axis labels with at least 16px of padding.

Four X-axis labels spaced evenly with enough padding.

Don’t place axis labels too closely together or angle the text.

Fifteen X-axis labels spaced tightly together and at an angle.

Shape

Do use 2px corner radii on outside corners of bar chart segments.

A bar chart with 2px rounded corners on each bar.

Don’t increase corner radii on bar charts. Rounded edges make the values harder to read and the bars harder to compare.

A bar chart with 100% rounded corners on each bar.

Density of bar charts

Do maintain between 12px and 24px wide bars with a minimum of 8px padding between them.

A bar chart containing 6 bars. Each bar is 16px and has 32px of space between them.

Don’t make bars smaller than 12px wide or decrease padding below 8px to show more data. Show less bars or use a different graph to achieve the density of data you are looking for.

A bar chart containing 36 bars. The bars are too thin and hard to read with condensed padding.

Number of data sets

Do show a max of 3 data sets per graph by default.

A line graph with 3 data sets as the default setting.

Don’t show more than 3 data sets by default. A max of 5 data sets can be displayed if the user turns on more.

A line graph with 5 data sets as the default setting.

Interactivity

Do ensure interactive tooltips are aligned above all key shapes and data in the graph, even if they overlap the title or controls. Always include the value and label for each data set within the tooltip.

Stacked area chart with a tooltip above the dots on the X-axis. The tooltip contains labels with values.

Don’t align interactive tooltips to the left or right where users fingers may cover important data on touch screens. And don’t rely on the order alone to express the meaning of values.

Stacked area chart with a tooltip to the right of the dots on the X-axis. The tooltip contains only values and now labels.

Graph color

Do use the color themes defined for each graph type and the ordering defined based on number of data sets.

A stacked area chart using an approved blue color palette.

Don’t use colors intended for one chart type in another, such as applying line graph colors in an area chart, and don't create new color themes for graphs that aren’t part of the system.

A stacked area chart using an unapproved pink color palette that’s meant for line graphs.

Change log

VersionDateNotes
2.0.0
Aug, 2024
  • Updated to eBay Evo
2.0.0
Apr, 2024
  • Updated colors to new color palette
2.0.0
Nov, 2022
  • Reduced radii on bar charts down to 2px to increase legibility
  • Reduced radii on donut charts down to 2px for small size and 4px for large size to increase legibility
  • Updated colors used for each chart & graph
  • Added new shapes on line graphs with multiple data sets to address accessibility bugs
  • Updated interactive state styling and guidance to be consistent across platforms & address accessibility concerns
  • Added guidance on scaling, axis and baseline labeling
1.0.0
Aug, 2021
  • Initial publish