Skip to content

Commit a45b0d5

Browse files
Add information on chart color usage
1 parent 701573e commit a45b0d5

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

.pf-ai-documentation/charts/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,34 @@ Module not found: Can't resolve '@patternfly/react-charts'
7575
7676
## Chart Implementation Rules
7777
78+
### Best Practices
79+
80+
### Color families
81+
- Chart color families include
82+
- red-orange
83+
- orange
84+
- yellow
85+
- teal
86+
- green
87+
- blue
88+
- purple
89+
- black
90+
- Use the same brightness of colors first, then use other brightness
91+
- Base: 300
92+
- Lightest: 100
93+
- Darkest: 500
94+
- Second-lightest: 200
95+
- Second-darkest: 400
96+
- Use PatternFly tokens to define your color variables
97+
- --pf-t-chart-color-[color-family]-[brightness]
98+
- example: --pf-t-chart-color-blue-300
99+
- When selecting colors for your chart, adhere to these general rules:
100+
- Within a color family, use the base color first. Then use the other lighter and darker hues.
101+
- Some families have predetermined uses:
102+
- Blue: Use to show success.
103+
- Red-orange: Use to show failure. Do not use this family unless you're communicating failure.
104+
- Other colors: Use for neutral purposes or categories.
105+
78106
### Color Rules
79107
- ✅ **Use PatternFly chart color tokens** - For consistency with design system
80108
- ❌ **Don't use hardcoded colors** - Use design tokens instead

.pf-ai-documentation/troubleshooting/common-issues.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ Module not found: Can't resolve '@patternfly/react-charts'
156156
```jsx
157157
// ✅ Correct - Use design tokens
158158
const chartColors = [
159-
'var(--pf-v6-chart-color-blue-300)',
160-
'var(--pf-v6-chart-color-green-300)',
161-
'var(--pf-v6-chart-color-orange-300)'
159+
'var(--pf-t-chart-color-blue-300)',
160+
'var(--pf-t-chart-color-green-300)',
161+
'var(--pf-t-chart-color-orange-300)'
162162
];
163163
<ChartDonut colorScale={chartColors} />
164164
```

0 commit comments

Comments
 (0)