-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(FOROME-936): reduced maximum items for bar chart (#609)
- Loading branch information
Showing
7 changed files
with
49 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
27 changes: 20 additions & 7 deletions
27
src/pages/filter/common/groups/chart/bar-chart/bar-chart.tsx
This file contains 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 |
---|---|---|
@@ -1,28 +1,41 @@ | ||
import { ReactElement } from 'react' | ||
|
||
import { t } from '@i18n' | ||
import { SvgChart } from '@components/svg-chart/svg-chart' | ||
import { TBarChartData } from '../chart.interface' | ||
import { BarChartSvg } from './bar-chart.styles' | ||
import { drawBarChart } from './bar-chart.utils' | ||
|
||
interface IBarChartProps { | ||
data: TBarChartData | ||
totalItems: number | ||
width?: number | ||
height?: number | ||
} | ||
|
||
export const BarChart = ({ | ||
data, | ||
totalItems, | ||
width, | ||
height, | ||
}: IBarChartProps): ReactElement => { | ||
return ( | ||
<SvgChart | ||
component={BarChartSvg} | ||
width={width} | ||
height={height} | ||
data={data} | ||
render={drawBarChart} | ||
/> | ||
<div> | ||
<SvgChart | ||
component={BarChartSvg} | ||
width={width} | ||
height={height} | ||
data={data} | ||
render={drawBarChart} | ||
/> | ||
{totalItems > data.length && ( | ||
<div className="text-xs text-grey-blue text-center mt-1 -mb-1"> | ||
{t('filter.chart.shownSignificantItems', { | ||
items: data.length, | ||
total: totalItems, | ||
})} | ||
</div> | ||
)} | ||
</div> | ||
) | ||
} |
This file contains 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 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 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 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 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