Skip to content

Commit

Permalink
fixing y-axis chart
Browse files Browse the repository at this point in the history
  • Loading branch information
cauemarcondes committed Sep 18, 2020
1 parent 3101ca3 commit 7bd010d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui';
import theme from '@elastic/eui/dist/eui_theme_light.json';
import { i18n } from '@kbn/i18n';
import { max } from 'lodash';
import React, { useCallback } from 'react';
import { useParams } from 'react-router-dom';
import { asPercent } from '../../../../../common/utils/formatters';
Expand Down Expand Up @@ -56,6 +57,7 @@ export function ErroneousTransactionsRateChart() {
);

const errorRates = data?.erroneousTransactionsRate || [];
const maxRate = max(errorRates.map((errorRate) => errorRate.y));

return (
<EuiPanel>
Expand All @@ -70,7 +72,7 @@ export function ErroneousTransactionsRateChart() {
<CustomPlot
{...syncedChartsProps}
noHits={data?.noHits}
yMax={1}
yMax={maxRate === 0 ? 1 : undefined}
series={[
{
color: theme.euiColorVis7,
Expand Down

0 comments on commit 7bd010d

Please sign in to comment.