diff --git a/packages/charts/package.json b/packages/charts/package.json index 70e09d1d608..bb17637dfab 100644 --- a/packages/charts/package.json +++ b/packages/charts/package.json @@ -17,7 +17,7 @@ "postbuild": "rollup -c" }, "devDependencies": { - "@types/chart.js": "^2.7.53" + "@types/chart.js": "^2.7.56" }, "dependencies": { "@ui5/webcomponents-react-base": "0.4.2-rc.7", diff --git a/packages/charts/src/components/BarChart/__snapshots__/BarChart.test.tsx.snap b/packages/charts/src/components/BarChart/__snapshots__/BarChart.test.tsx.snap index d61865f9b5d..9f6620cb655 100644 --- a/packages/charts/src/components/BarChart/__snapshots__/BarChart.test.tsx.snap +++ b/packages/charts/src/components/BarChart/__snapshots__/BarChart.test.tsx.snap @@ -114,5 +114,8 @@ exports[`BarChart loading placeholder 1`] = ` +
`; diff --git a/packages/charts/src/components/BarChart/index.tsx b/packages/charts/src/components/BarChart/index.tsx index 63786742fe5..119dee6dca4 100644 --- a/packages/charts/src/components/BarChart/index.tsx +++ b/packages/charts/src/components/BarChart/index.tsx @@ -1,11 +1,13 @@ import { useConsolidatedRef } from '@ui5/webcomponents-react-base'; import bestContrast from 'get-best-contrast-color'; -import React, { forwardRef, Ref, RefObject, useCallback, useEffect, useRef, useMemo } from 'react'; +import React, { forwardRef, Ref, useMemo } from 'react'; import { HorizontalBar } from 'react-chartjs-2'; import { useTheme } from 'react-jss'; import { DEFAULT_OPTIONS } from '../../config'; import { ChartBaseProps } from '../../interfaces/ChartBaseProps'; -import { withChartContainer } from '../../internal/ChartContainer/withChartContainer'; +import { InternalProps } from '../../interfaces/InternalProps'; +import { useLegend, useLegendItemClickHandler } from '../../internal/ChartLegend'; +import { withChartContainer } from '../../internal/withChartContainer'; import { ChartBaseDefaultProps } from '../../util/ChartBaseDefaultProps'; import { useChartData } from '../../util/populateData'; import { formatTooltipLabel, getTextWidth, useMergedConfig } from '../../util/utils'; @@ -25,38 +27,14 @@ const BarChartComponent = forwardRef((props: BarChartPropTypes, ref: Ref