-
Notifications
You must be signed in to change notification settings - Fork 114
Highcharts #5390
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
Open
tycup
wants to merge
43
commits into
main
Choose a base branch
from
highcharts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5,964
−5
Open
Highcharts #5390
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
137c809
Highcharts Theme | LineChart (#5246)
tycup 43aa492
Add DonutChart with patterns, useChart hook, and density support
tycup 4d31784
Add PieChart
tycup f4bba0a
Refactor Highcharts useChart hook
tycup 5fcb2a0
Add Stacked Bar Chart
tycup 29013be
Bug Fixes & Doc Enhancements
tycup a9563bd
Pin Highcharts to v10.2.0 specifically and v11+
tycup 59613c7
Add Bullet Chart
tycup 5f3f7a4
Fix: Use bullet chart type (#5599)
tycup b838b99
Highcharts | Fix CSS link for v11+ (#5606)
tycup c746357
Highcharts | Update snapshot link (#5609)
tycup 3bef5ba
Add Bar Chart
tycup 3d1da8d
Add Column Chart
tycup 53a920c
fix spelling
tycup f01e6be
Add Area Chart
tycup 6a9ad7f
update useChart hook docs
tycup 2f399a6
Update snapshot install link
tycup 7211647
update snapshot - adds area chart
tycup da7fc24
Add Scatter Chart
tycup 0f20b6e
Add Bubble Chart
tycup 0c19789
combine bubble and scatter opacity selectors
tycup ada0f09
updat snapshot link
tycup 388c9b5
Highcharts | Add Box Plot Chart (#5675)
tycup 6490704
Highcharts | Waterfall Chart (#5728)
tycup 6af8c5a
Update highcharts snapshot (#5798)
joshwooding 82930a6
Candlestick Chart (#5744)
tycup 29ced08
Add data visualization tokens (#5846)
joshwooding d85918e
prepare for versioning
tycup dae48d3
remove warning and use better token
tycup e1c541d
Highcharts | Use dataviz tokens (#5858)
tycup 25d98a2
update readme
tycup 5f3d078
Revert "update readme"
tycup 52d901a
use tooltip to guide on patterns and fills
tycup a990682
add parent track ticket and single fill/line pattern message
tycup 9a3fb72
patch fix
tycup 1d250b7
ensure accessible read out of data points
tycup 665fa4f
Update site/docs/components/chart/examples.mdx
tycup c5cbc64
ensure correct focus order in stacked bar
tycup f6760e0
prevent blurry border around legend
tycup 2c6efc3
improve readme
tycup d84105f
prevent race condition
tycup bf05cd4
ensure RC status
tycup 783e4c0
prevent strikethrough on hidden legend and border radius in v12
tycup File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@salt-ds/highcharts-theme": minor | ||
| --- | ||
|
|
||
| Added Stacked bar chart | ||
|
|
||
| To see an example Options object required to configure a basic stacked bar chart, see the examples section. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@salt-ds/highcharts-theme": minor | ||
| --- | ||
|
|
||
| Added Area chart | ||
|
|
||
| To see an example Options object required to configure a basic area chart, see the examples section. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@salt-ds/highcharts-theme": minor | ||
| --- | ||
|
|
||
| Added Candlestick Chart | ||
|
|
||
| To see an example Options object required to configure a basic candlestick chart, see the examples section. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| --- | ||
| "@salt-ds/theme": minor | ||
| --- | ||
|
|
||
| Added new categorical and sentiment data visualization tokens. | ||
|
|
||
| ## Category | ||
|
|
||
| - `--salt-category-1-dataviz` | ||
| - `--salt-category-2-dataviz` | ||
| - `--salt-category-3-dataviz` | ||
| - `--salt-category-4-dataviz` | ||
| - `--salt-category-5-dataviz` | ||
| - `--salt-category-6-dataviz` | ||
| - `--salt-category-7-dataviz` | ||
| - `--salt-category-8-dataviz` | ||
| - `--salt-category-9-dataviz` | ||
| - `--salt-category-10-dataviz` | ||
| - `--salt-category-11-dataviz` | ||
| - `--salt-category-12-dataviz` | ||
| - `--salt-category-13-dataviz` | ||
| - `--salt-category-14-dataviz` | ||
| - `--salt-category-15-dataviz` | ||
| - `--salt-category-16-dataviz` | ||
| - `--salt-category-17-dataviz` | ||
| - `--salt-category-18-dataviz` | ||
| - `--salt-category-19-dataviz` | ||
| - `--salt-category-20-dataviz` | ||
|
|
||
| ## Sentiment | ||
|
|
||
| - `--salt-positive-dataviz` | ||
| - `--salt-negative-dataviz` | ||
| - `--salt-neutral-dataviz` | ||
| - `--salt-caution-dataviz` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@salt-ds/highcharts-theme": minor | ||
| --- | ||
|
|
||
| Added Bar Chart | ||
|
|
||
| To see an example Options object required to configure a basic bar chart, see the examples section. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@salt-ds/highcharts-theme": minor | ||
| --- | ||
|
|
||
| Add Bubble Chart | ||
|
|
||
| To see an example Options object required to configure a basic bubble chart, see the examples section. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| "@salt-ds/highcharts-theme": minor | ||
| --- | ||
|
|
||
| - Added PieChart | ||
| - Since DonutChart is a variant of PieChart,the plotOptions.pie.innerSize setting is moved out of the global options; otherwise, a default PieChart would automatically become a DonutChart | ||
| - Consumers are instructed to supply the innerSize setting themselves in documentation. | ||
| - Documentation reordered to show PieChart first due to the above. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@salt-ds/highcharts-theme": minor | ||
| --- | ||
|
|
||
| Added Bullet Chart | ||
|
|
||
| To see an example Options object required to configure a basic bullet chart, see the examples section. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| "@salt-ds/highcharts-theme": minor | ||
| --- | ||
|
|
||
| - `useChart` hook is density-aware. When Salt density changes, it triggers a `chart.redraw()` and returns a `legendIconSize` mapped to Salt size tokens, enabling responsive legend symbol sizing. | ||
| - Salt theme defaults (styled mode): 20-color palette, vertical right-aligned legend with consistent spacing, larger title/axis-title margins, and line markers disabled by default. | ||
| - Type compatibility: expose `HighchartsOptionsCompat` so newer fields (e.g. `plotOptions.pie.borderRadius`) type-check while staying assignable to upstream `Options` across Highcharts v10–v12. | ||
| - CSS and usage guidance: import Salt base styles before the Highcharts theme, and wrap charts with `highcharts-theme-salt`; add `salt-fill-patterns` to opt into pattern fills. | ||
| Example: `import "@salt-ds/theme/index.css"; import "@salt-ds/highcharts-theme/index.css";` | ||
|
|
||
| Includes a Donut chart example using `useDensity` + `useChart` to demonstrate density reactivity and optional pattern fills. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| --- | ||
| "@salt-ds/highcharts-theme": minor | ||
| --- | ||
|
|
||
| ### Summary | ||
|
|
||
| Salt Highcharts theme is a package that supplies the Salt theme for Highcharts. It includes a CSS file for all CSS-based styles, and an options object for styles that are not CSS configurable. Together, they provide a complete theming solution for Highcharts version 10 to version 12. | ||
|
|
||
| _Please note, this package is a WIP. Highcharts CSS files and Options object are not finalised._ | ||
|
|
||
| ### Rationale | ||
|
|
||
| A theme-only package for Highcharts offers a lightweight solution focused solely on styling, making it easier to maintain and update visual consistency across charts. Unlike a full React wrapper, it doesn't impose additional abstraction layers, allowing developers to leverage Highcharts' native capabilities directly. This approach minimizes overhead and complexity, providing flexibility to integrate with various frameworks or environments without being tied to a specific implementation. | ||
|
|
||
| ### Supported charts | ||
|
|
||
| This package is a work in progress and represents a snapshot release focusing specifically on the LineChart. | ||
|
|
||
| Our intent is to gather feedback on the provided solution, allowing us to refine and expand the theme to support additional chart types in future, incremental releases. | ||
|
|
||
| ### Usage | ||
|
|
||
| Please see the package [README.md](https://github.com/jpmorganchase/salt-ds/blob/main/packages/highcharts-theme/README.md) for guidance on usage. | ||
|
|
||
| ### License | ||
|
|
||
| A license is required to use Highcharts. | ||
|
|
||
| ### Migration | ||
|
|
||
| The Salt Highcharts theme replaces previous approaches that bundled a chart wrapper with styling. Because this package contains **only** theme assets (CSS + Highcharts options), you can keep using any Highcharts integration you prefer and simply apply the theme. | ||
|
|
||
| **Steps to migrate** | ||
|
|
||
| 1. **Install the package** (snapshot build, requires Highcharts 10 – 12): | ||
|
|
||
| ```bash | ||
| # npm | ||
| npm install @salt-ds/highcharts-theme | ||
|
|
||
| # yarn | ||
| yarn add @salt-ds/highcharts-theme | ||
| ``` | ||
|
|
||
| 2. **Import the theme resources** at your application entry point: | ||
|
|
||
| ```ts | ||
| import "@salt-ds/highcharts-theme/index.css"; | ||
|
|
||
| // Salt CSS overrides | ||
| import Highcharts from "highcharts"; | ||
| import { highchartsOptionsSalt } from "@salt-ds/highcharts-theme"; | ||
|
|
||
| // apply global theme options | ||
| Highcharts.setOptions(highchartsOptionsSalt); | ||
| ``` | ||
|
|
||
| 3. **Continue using your existing chart code.** For React you might use `highcharts-react-official` (or any other wrapper): | ||
|
|
||
| ```jsx | ||
| <div className="highcharts-theme-salt"> | ||
| <HighchartsReact highcharts={Highcharts} options={chartOptions} /> | ||
| </div> | ||
| ``` | ||
|
|
||
| 4. **Merge additional options as required.** Highcharts deep-merges subsequent calls to `Highcharts.setOptions`; you can also combine objects per-chart with `Highcharts.merge()`. | ||
|
|
||
| **Things to watch for:** | ||
|
|
||
| - This snapshot styles **LineChart** only; other chart types will fall back to default Highcharts styles until future releases. | ||
| - Ensure the Salt CSS is loaded **after** the default Highcharts CSS to guarantee correct specificity. | ||
| - If a previous wrapper injected theme styles automatically, you must now call `Highcharts.setOptions` yourself and add the `highcharts-theme-salt` class to chart containers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@salt-ds/highcharts-theme": minor | ||
| --- | ||
|
|
||
| Added Box plot chart | ||
|
|
||
| To see an example Options object required to configure a basic box plot chart, see the examples section. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Salt Highcharts Theme | ||
|
|
||
| `@salt-ds/highcharts-theme` provides Salt styling and default configuration for [Highcharts](https://www.highcharts.com/). | ||
|
|
||
| See the Salt docs for usage, examples, and accessibility guidance: [Chart](https://www.saltdesignsystem.com/salt/components/chart). | ||
|
|
||
| ## Highcharts support | ||
|
|
||
| Compatible with **Highcharts 10.2.0** (specifically) and **Highcharts 11+**. | ||
|
|
||
| ## License | ||
|
|
||
| A Highcharts license is required. | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| npm install [email protected] highcharts-react-official @salt-ds/highcharts-theme | ||
| # or | ||
| yarn add [email protected] highcharts-react-official @salt-ds/highcharts-theme | ||
| ``` | ||
|
|
||
| ## Quick start | ||
|
|
||
| Import Highcharts CSS **before** the Salt theme CSS (see Highcharts docs: [Style by CSS](https://www.highcharts.com/docs/chart-design-and-style/style-by-css)). | ||
|
|
||
| - Highcharts v10.2.0 CSS: `https://code.highcharts.com/10.2.0/css/highcharts.css` | ||
| - Highcharts v11+ CSS: `https://code.highcharts.com/your-version/css/highcharts.css` | ||
|
|
||
| ```jsx | ||
| import Highcharts from "highcharts"; | ||
| import HighchartsReact from "highcharts-react-official"; | ||
| import { useRef } from "react"; | ||
| import { useChart } from "@salt-ds/highcharts-theme"; | ||
|
|
||
| import "@salt-ds/highcharts-theme/index.css"; | ||
|
|
||
| export function MyChart({ chartOptions }) { | ||
| const chartRef = useRef(null); | ||
| const options = useChart(chartRef, chartOptions); | ||
|
|
||
| return ( | ||
| <div className="highcharts-theme-salt"> | ||
| <HighchartsReact | ||
| ref={chartRef} | ||
| highcharts={Highcharts} | ||
| options={options} | ||
| /> | ||
| </div> | ||
| ); | ||
| } | ||
| ``` | ||
|
|
||
| ## Optional container classes | ||
|
|
||
| See [Chart usage](https://www.saltdesignsystem.com/salt/components/chart/usage) for details. | ||
|
|
||
| - `salt-line-patterns` | ||
| - `salt-fill-patterns` | ||
| - `axes-grid-lines` | ||
|
|
||
| ## Accessibility | ||
|
|
||
| Enable the Highcharts accessibility module (v10 requires initialization; v11+ auto-initializes). See [Chart accessibility](https://www.saltdesignsystem.com/salt/components/chart/accessibility). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| /* Pattern fills for pie/donut charts */ | ||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-0:not(.highcharts-data-label-connector) { | ||
| fill: url(#diagonal-up); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-1:not(.highcharts-data-label-connector) { | ||
| fill: url(#dot); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-2:not(.highcharts-data-label-connector) { | ||
| fill: url(#zigzag); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-3:not(.highcharts-data-label-connector) { | ||
| fill: url(#vertical-lines); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-4:not(.highcharts-data-label-connector) { | ||
| fill: url(#diagonal-down); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-5:not(.highcharts-data-label-connector) { | ||
| fill: url(#upward-point); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-6:not(.highcharts-data-label-connector) { | ||
| fill: url(#horizontal-lines); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-7:not(.highcharts-data-label-connector) { | ||
| fill: url(#crosshatch); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-8:not(.highcharts-data-label-connector) { | ||
| fill: url(#net); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-9:not(.highcharts-data-label-connector) { | ||
| fill: url(#steps); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-10:not(.highcharts-data-label-connector) { | ||
| fill: url(#pavement); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-11:not(.highcharts-data-label-connector) { | ||
| fill: url(#scallop); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-12:not(.highcharts-data-label-connector) { | ||
| fill: url(#vertical-wave); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-13:not(.highcharts-data-label-connector) { | ||
| fill: url(#metal); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-14:not(.highcharts-data-label-connector) { | ||
| fill: url(#scales); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-15:not(.highcharts-data-label-connector) { | ||
| fill: url(#triangle); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-16:not(.highcharts-data-label-connector) { | ||
| fill: url(#horizontal-wave); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-17:not(.highcharts-data-label-connector) { | ||
| fill: url(#cage); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-18:not(.highcharts-data-label-connector) { | ||
| fill: url(#line-dot); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-color-19:not(.highcharts-data-label-connector) { | ||
| fill: url(#squares); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-waterfall-series .highcharts-point, | ||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-candlestick-series .highcharts-point { | ||
| fill: url(#positive-sentiment); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-waterfall-series .highcharts-point.highcharts-negative { | ||
| fill: url(#negative-sentiment); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-candlestick-series .highcharts-point-down { | ||
| fill: url(#negative-sentiment); | ||
| } | ||
|
|
||
| .highcharts-theme-salt.salt-fill-patterns .highcharts-waterfall-series .highcharts-point.highcharts-sum { | ||
| fill: url(#neutral-sentiment); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| .highcharts-theme-salt .highcharts-legend-item:hover text { | ||
| fill: var(--salt-content-secondary-foreground); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.