Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(charts): Support for theme #114

Merged
merged 2 commits into from
Sep 4, 2023
Merged

feat(charts): Support for theme #114

merged 2 commits into from
Sep 4, 2023

Conversation

dengfuping
Copy link
Collaborator

@dengfuping dengfuping commented Sep 4, 2023

Summary

  • 支持设置图表主题,包括单个图表和全局配置,并新增 暗色主题

Design Token of dark theme

  • 暂时通过 coolors 平台根据浅色主题自动生成,后续设计侧产出暗色主题 Token 后再做替换。

image

Usage

import { Line, ChartProvider } from '@oceanbase/charts';

// 单个图表: 浅色主题 (默认主题)
<Line theme="light" />

// 单个图表: 暗色主题
<Line theme="dark" />

// 单个图表: 自定义主题
<Line theme={{ defaultColor: 'xxx', colors10: ['xxx1', 'xxx2'] }} />

// 全局配置: 浅色主题 (默认主题)
<ChartProvider theme="light">
  <Line />
</ChartProvider>

// 全局配置: 浅色主题 (默认主题)
<ChartProvider theme="dark">
  <Line />
</ChartProvider>

// 全局配置: 浅色主题 (默认主题)
<ChartProvider theme={{ defaultColor: 'xxx', colors10: ['xxx1', 'xxx2'] }}>
  <Line />
</ChartProvider>

Demo

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

@github-actions
Copy link

github-actions bot commented Sep 4, 2023

@dengfuping dengfuping merged commit 51d0193 into master Sep 4, 2023
@dengfuping dengfuping mentioned this pull request Sep 4, 2023
97 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant