Skip to content

Commit

Permalink
fixed bar chart display for NA count 0
Browse files Browse the repository at this point in the history
  • Loading branch information
olzhasmukayev committed Mar 28, 2024
1 parent 1c4878a commit 1b90a54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/studyView/charts/barChart/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default class BarChart extends React.Component<IBarChartProps, {}>

@computed
get tickValuesBasedOnNA(): number[] {
if (this.props.showNAChecked) {
if (this.props.showNAChecked || !this.numberOfNA) {
return this.tickValues;
}
const tickValuesWithoutNA = this.tickValues.slice(0, -this.numberOfNA);
Expand Down Expand Up @@ -274,7 +274,7 @@ export default class BarChart extends React.Component<IBarChartProps, {}>

@computed
get labelShowingNA(): JSX.Element | null {
if (!this.props.showNAChecked) {
if (!this.props.showNAChecked && this.numberOfNA) {
const labelNA = this.barDataWithNA
.map((element: BarDatum) => element.dataBin.count)
.join(', ');
Expand Down

0 comments on commit 1b90a54

Please sign in to comment.