Skip to content

Commit

Permalink
Stacked Bars Colors Fix (#343)
Browse files Browse the repository at this point in the history
* Stacked Bars COlors FIx

* Workaround source map warning

* No multicolor on singles

* fix on long lists
  • Loading branch information
BennuFire authored Feb 6, 2023
1 parent 0e04c0d commit a8dea8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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/],
};
};

0 comments on commit a8dea8e

Please sign in to comment.