Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3b5da6d
Rework existing data viz docs, add new tabs, add rough preliminary text
KristinLBradley Sep 10, 2025
284622a
Edit accessibility tab content to simplify
KristinLBradley Sep 10, 2025
715e266
Add code examples to Code tab
KristinLBradley Sep 10, 2025
3cb7841
Update Code tab content
KristinLBradley Sep 10, 2025
4d109bf
Updates to guidelines page
LilithJames-HDS Sep 10, 2025
1812892
Update for-designers.md
LilithJames-HDS Sep 10, 2025
f4c643d
Delete outdated comments, fix typo
KristinLBradley Sep 10, 2025
4d851a6
Add more accessibility tips to data viz Accessibility tab
KristinLBradley Sep 11, 2025
63ae9fb
Updated image and new donut chart image
LilithJames-HDS Sep 11, 2025
40aa725
Add info on when to use a data viz
KristinLBradley Sep 11, 2025
d62a0a7
Update guidelines.md
LilithJames-HDS Sep 11, 2025
d120ff2
Add banner to Accessibility content and update some wording
KristinLBradley Sep 11, 2025
56c2de0
Apply suggestions from code review
KristinLBradley Sep 11, 2025
59fa3f8
Apply suggestions from code review
KristinLBradley Sep 12, 2025
d25362a
Apply suggestions from code review
KristinLBradley Sep 12, 2025
90e1023
Text updates from feedback
KristinLBradley Sep 12, 2025
e05fdd0
Update Code tab content to make it more general and include additiona…
KristinLBradley Sep 12, 2025
2b4f41d
Apply suggestions from code review
LilithJames-HDS Sep 12, 2025
e675dc9
Updates based on feedback
LilithJames-HDS Sep 12, 2025
a5572d9
Image update
LilithJames-HDS Sep 12, 2025
1fca694
Apply suggestions from code review
LilithJames-HDS Sep 12, 2025
d6ea730
Update website/docs/patterns/data-visualization/partials/guidelines/g…
LilithJames-HDS Sep 12, 2025
e87619d
Apply suggestions from code review
KristinLBradley Sep 12, 2025
5ef170b
Update Code tab content to add list of resources & steps to install, …
KristinLBradley Sep 12, 2025
abb15d8
Add example Ember component using Carbon Charts Donut
KristinLBradley Sep 13, 2025
461488c
removed live example of Carbon Donut Chart with static screenshot and…
didoo Sep 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions website/docs/getting-started/for-designers.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The Design Systems Team maintains and publishes Figma libraries which contain fo
- [HDS Product Foundations v2.0](https://www.figma.com/design/uX4OEaJQdWfzULADchjAeN/HDS-Foundations-v2.0?node-id=2916-4&t=z7hDCKFFuGUMDRYe-1)
- [HDS Product Patterns v2.0](https://www.figma.com/design/5Pv32j4QiOOD8lkFTD1dxC/HDS-Patterns-v2.0?node-id=2-45&t=cpJowBg8aXp4qAG1-1)
- [HDS Icons](https://www.figma.com/design/TLnoT5AYQfy3tZ0H68BgOr/HDS-Icons?m=auto&node-id=164-0&t=uqfJ7Wtjy9AfhBtY-1)
- [Carbon Charts](https://www.figma.com/design/k34tT4poC2p1RBQxVwZhW5/-Alpha--Carbon-Charts-Library-Kit-%E2%80%93-Carbon-Design-System--Copy-?node-id=3984-105570&t=YIZdjDNDhgDMtXBd-1)

![Opening the library selection menu](/assets/getting-started/designers/enable-libraries-toggle.png)

Expand Down Expand Up @@ -175,6 +176,10 @@ HashiCorp product teams can use the Helios libraries published under the [HDS De
- [Wireframe UI Kit](https://www.figma.com/design/w0ukydeAsbv6sJirLxZMBo/HDS-Wireframes?m=auto&t=JLqmUYB9fZbdWaa2-6): low-fidelity versions of HDS components designed to help quickly sketch ideas and build flows.
- [Utility UI Kit](https://www.figma.com/design/vqhh0wWZ8PwnRkvh1jk7jB/Utilities-UI-Kit?m=auto&t=JLqmUYB9fZbdWaa2-6): common UI helpers like documentation styles and annotations, and external utilities like browser scroll bars and cursors.

### Other Figma libraries

- [Carbon Charts](https://www.figma.com/design/k34tT4poC2p1RBQxVwZhW5/-Alpha--Carbon-Charts-Library-Kit-%E2%80%93-Carbon-Design-System--Copy-?node-id=3984-105570&t=YIZdjDNDhgDMtXBd-1): a library including various data visualization components created by the Carbon Design Systems team.

### Recommended plugins

We don’t recommend tying core design functionality to third-party plugins because Figma doesn’t directly supported them. That said, we find the following plugins to be useful support mechanisms:
Expand Down Expand Up @@ -202,3 +207,5 @@ Explore more content about libraries, components, and styles directly from Figma
## Support

If you have questions or need assistance using Helios libraries, <LinkTo class="doc-link-generic" @route="show" @model="about/support">contact the Design Systems Team</LinkTo>.

If you have questions or need assistance using the Carbon Charts library, please contact the Carbon Design Team via the IBM Slack channel [#carbon-charts-design](https://ibm.enterprise.slack.com/archives/C01DTUSCQAJ) and/or [#carbon-charts](https://ibm.enterprise.slack.com/archives/CCA7L4MS9).
15 changes: 11 additions & 4 deletions website/docs/patterns/data-visualization/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@ navigation:
keywords: ['charts', 'color', 'data', 'palette']
---

<section data-tab="Color usage">
@include "partials/guidelines/specifications.md"
@include "partials/guidelines/accessibility.md"
@include "partials/guidelines/color-usage.md"
<section data-tab="Guidelines">
@include "partials/guidelines/overview.md"
@include "partials/guidelines/guidelines.md"
</section>

<section data-tab="Code">
@include "partials/code.md"
</section>

<section data-tab="Accessibility">
@include "partials/accessibility.md"
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
!!! Info

Refer to [Carbon’s Accessibility page](https://carbondesignsystem.com/guidelines/accessibility/overview/) for complete guidelines.

!!!

## Conformance rating

Because this is an IBM Carbon component, please refer to their documentation for conformance information.

## Accessibility considerations

### Add labels to charts & chart elements

Text-based labels on charts and chart elements must be present. Text must not be truncated because keyboard-only users have no way to access truncated data. While the Carbon Charts components include `truncation` options for text, the value should be set to `false` in order to meet our conformance requirements.

![Bar chart showing average billable managed resources, with a text label indicating the month and year beneath each bar.](/assets/patterns/data-visualization/color-usage/data-visualization-ally-label.png)
<Doc::ImageCaption @text="Clearly labeling elements can enhance the experience for all users." />

### Don’t rely on color only to convey information

Be sure to always add appropriate text, such as labels or descriptions of the visual information in the chart. Using patterns, in addition to (or instead of) color can enhance accessibility, although Carbon Charts components and palettes don’t include them at this time. A thin separating line between adjacent colors helps to visually distinguish chart areas.

![Donut chart showing the status of service instances, there is a thin white line each section of the donut.](/assets/patterns/data-visualization/color-usage/data-visualization-ally-donut.png)
<Doc::ImageCaption @text="Carbon Charts components include thin white separators to help distinguish colors" />

### Ensure charts are readable when resized

Always test that chart information is legible, even on smaller viewports, e.g., mobile devices. Per WCAG Success Criteria, users must also be able to zoom in on their browser ([up to 400%](https://www.w3.org/WAI/WCAG22/Understanding/reflow.html)) and also [resize text](https://www.w3.org/WAI/WCAG22/Understanding/resize-text.html) associated with charts.

### Use interactive elements appropriately

Interactive elements should have unique and clear labels to clearly differentiate them from one another and make their purpose clear.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I edited this down to cover only what is within consumer control/concern when using Carbon Charts components as they already build in keyboard navigation, aria labels, etc.

158 changes: 158 additions & 0 deletions website/docs/patterns/data-visualization/partials/code.md

This comment was marked as outdated.

Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
!!! Info

For more support in using the Carbon Chart library, please message the Carbon Core team in the IBM Slack channel [#carbon-charts-design](https://ibm.enterprise.slack.com/archives/C01DTUSCQAJ) or [#carbon-charts](https://ibm.enterprise.slack.com/archives/CCA7L4MS9).

!!!

## How to use Carbon Charts components

We recommend using the Vanilla JavaScript version of IBM’s [Carbon Chart components](https://charts.carbondesignsystem.com).

### Helpful resources

- [Carbon Charts Introduction](https://charts.carbondesignsystem.com/introduction)
- [Carbon Charts installation](https://charts.carbondesignsystem.com/installation)
- [Carbon Charts API](https://charts.carbondesignsystem.com/api/)

### Getting started

Refer to the [Carbon Charts installation & setup page](https://charts.carbondesignsystem.com/installation) for more complete instructions.

#### Basic steps

1. Install the Vanilla JavaScript Carbon Charts library as a dependency.
2. Import the component you wish to use, for example the `DonutChart`
3. Create an options.js file if you wish to customize the component’s available options.
4. Ensure components will have the correct visual appearance by
- linking to font definitions within your HTML document
- importing the component styles

### Importing files

In HTML:

```html{data-execute=false}
<link rel="stylesheet" href="https://1.www.s81c.com/common/carbon/plex/sans.css" />
<link rel="stylesheet" href="https://1.www.s81c.com/common/carbon/plex/sans-condensed.css" />
```

Within JavaScript:

```javascript
import { DonutChart } from '@carbon/charts';
import '@carbon/charts/styles.css';
```

### Ember component example

A simple example using the [Carbon Charts Donut](https://charts.carbondesignsystem.com/donut) component.

#### JavaScript

```javascript
// app/components/demo-carbon-donut/index.js

import Component from '@glimmer/component';
import { action } from '@ember/object';

import { DonutChart } from '@carbon/charts';
import data from './data';
import options from './options';
import '@carbon/charts/styles.css';

export default class DemoCarbonDonut extends Component {
chart = null;

@action
setupChart(element) {
// Merge the dynamic options into the default options
const chartOptions = {
...options,
title: this.args.title || options.title,
color: {
scale: this.args.colorMap,
},
};

// Create the DonutChart instance
this.chart = new DonutChart(element, {
data,
options: chartOptions,
});
}
}
```

#### Options.js file with example pre-set options

The component options, such as the [Donut Chart options](https://charts.carbondesignsystem.com/api/interfaces/donutchartoptions), can be set according to your needs. You can combine the preset options that you’ve included with dynamic options you’ve exposed.

```javascript
// app/components/demo-carbon-donut/options.js

export default {
title: '', // Set title using @title on the component
resizable: true,
legend: {
position: 'left', // = position relative to chart, options: 'top', 'bottom', 'left', 'right'
truncation: {
type: 'none',
},
},
donut: {
alignment: 'center', // = alignment w/i container, options: 'center', 'left', 'right'
},
pie: {
labels: {
enabled: true,
formatter: (data) => data.value,
},
},
height: '175px',
};
```

!!! info

Refer to the [Carbon Charts API docs](https://charts.carbondesignsystem.com/api/) for the full list of available options for each component type.

!!!


#### Template

Attach the `setupChart` action to a generic container element.

```handlebars{data-execute=false}
<!-- app/components/demo-carbon-donut/index.hbs -->

<div {{did-insert this.setupChart}} ...attributes></div>
```

#### Application

Font definition links should only be included once within the HTML application page.

```handlebars{data-execute=false}
<!-- app/index.html -->

<html lang="en">
<head>
...
<!-- include the Plex fonts in the main application -->
<link rel="stylesheet" href="https://1.www.s81c.com/common/carbon/plex/sans.css" />
<link rel="stylesheet" href="https://1.www.s81c.com/common/carbon/plex/sans-condensed.css" />
...
</head>
<body>
...
</body>
</html>
```


#### Rendered chart

This will render a chart similar to this one:

![Example of a rendered Carbon Donut Chart](/assets/patterns/data-visualization/code-demo-donut-chart.png)

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
## Deciding how best to represent data

Consider whether a data visualization is actually appropriate for the type of data you wish to present or whether a table may be clearer or more appropriate. Data visualizations offer a quick way to identify trends or patterns or as a way to visually summarize data. Tables, on the other hand, are better for examining precise or multi-dimensional data. Carbon Charts components, in a way, allow you to do both. The built-in toolbar enables users to view a table of the presented data in the data visualization.

### Considerations for using data visualization

- **Information density**: If a table requires too many columns to fit within a screen consider whether using a data visualization would make the information easier to consume.
- **Frequency of outliers**: If most data points are clustered but there are a few outliers, this is less apparent using a table so a data visualization may be clearer.

## Carbon charts components

IBM’s Carbon Design System includes various [chart components](https://carbondesignsystem.com/data-visualization/chart-types/) that we recommend using to create data visualizations. These components are available in Figma and code and utilize Carbon Elements for [font styles](https://carbondesignsystem.com/elements/typography/overview/) and [color palettes](https://carbondesignsystem.com/elements/color/overview/).

### Commonly used chart examples

- [Vertical bar charts](https://charts.carbondesignsystem.com/bar#vertical) are the most common representation of categorical data. They allow a user to quickly compare the amounts of a value based on the heights of the bars in the chart. Examples in our products may include displaying cost per month or resource use per quarter.

![Vertical bar chart data visualization](/assets/patterns/data-visualization/color-usage/data-visualization-example-vertical-bar.png)

- [Proportional meters]( https://carbondesignsystem.com/data-visualization/simple-charts/#meter-(proportional)) are used to show the breakdown of categories within a bar that equal 100% of the bar. This is may be used in our products to show the health of a group of resources or the amount of resources used toward a specific cap.

![Proportional meter chart data visualization](/assets/patterns/data-visualization/color-usage/data-visualization-example-proportional-meter.png)

- [Donut charts](https://carbondesignsystem.com/data-visualization/simple-charts/#donut) are circular graphs that display data as a portion of a whole divided into slices. This type of chart may be used in a similar way as proportional meter charts but offers a different presentation of the information.

![Donut chart data visualization](/assets/patterns/data-visualization/color-usage/data-visualization-example-donut.png)


## Color palettes

When creating data visualizations, use the color palette created for the type of data being presented and consider that color choice can impact meaning. Carbon Charts offers preset [color palettes](https://carbondesignsystem.com/data-visualization/color-palettes/) for each type of data representation, making it simple to select appropriate and accessibility-compliant values.

There are three main types of color palettes used in data visualization:

1. Categorical palettes
2. Sequential palettes
3. Diverging palettes

Carbon’s data visualization palettes include categorical palettes with one to five colors, a full categorical palette for needs requiring more than five distinctions, a sequential palette, a diverging palette, and a gradient palette.

### Categorical palettes

Use categorical palettes for presenting data that has no intrinsic order, such as in a pie or donut chart. They are also good for multi-line charts, area charts, stacked or grouped bar charts, etc.

![](/assets/patterns/data-visualization/color-usage/data-visualization-categorical.png)

### Sequential palettes

Use sequential palettes for quantitative or ordered values in a continuum. This palette is useful for heat maps and grouped horizontal bar charts that compare sequential groups, such as age ranges, etc.

![](/assets/patterns/data-visualization/color-usage/data-visualization-sequential.png)

A gradient palette is a type of sequential palette that can be used to distinguish elements without inherent axes or directions, such as in maps or geographic representations.

![](/assets/patterns/data-visualization/color-usage/data-visualization-graduated-sequence.png)

### Diverging palettes

Use diverging palettes when presenting two sequences of ordered values that share a central value. This type of palette can be used for diverging bar charts, horizon charts, heat maps, etc.

![](/assets/patterns/data-visualization/color-usage/data-visualization-diverging.png)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
We recommend using Carbon Design System's [Carbon Charts](https://charts.carbondesignsystem.com/introduction) for data visualizations in HashiCorp products.

We've imported the latest [Carbon Charts Figma library](https://www.figma.com/design/k34tT4poC2p1RBQxVwZhW5/-Alpha--Carbon-Charts-Library-Kit-%E2%80%93-Carbon-Design-System--Copy-?node-id=3984-105570&t=YIZdjDNDhgDMtXBd-1) into the HashiCorp Figma instance. To use these components in Figma, enable the library as you would any other HDS library.

To get support when using the Carbon Chart library, please message the Carbon Core team in the IBM Slack channel [#carbon-charts-design](https://ibm.enterprise.slack.com/archives/C01DTUSCQAJ) or [#carbon-charts](https://ibm.enterprise.slack.com/archives/CCA7L4MS9).

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.