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

Stacked Bars Colors Fix #343

Merged
merged 4 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions src/chart/bar/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ const NeoBarChart = (props: ChartProps) => {

// Compute bar color based on rules - overrides default color scheme completely.
const getBarColor = (bar) => {
let { index } = bar;
let colorIndex = index;
if (index >= chartColorsByScheme.length) {
colorIndex = index % chartColorsByScheme.length;
let { data, id } = bar;
let colorIndex = Object.keys(data).indexOf(id);
if (colorIndex >= chartColorsByScheme.length) {
colorIndex %= chartColorsByScheme.length;
}

const dict = {};
Expand Down
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ module.exports = (env) => {
hot: true,
},
plugins: production ? [] : [new webpack.HotModuleReplacementPlugin()],
ignoreWarnings: [/Failed to parse source map/],
};
};