forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APM] Don't show annotations on charts with no data (elastic#68829)
Hide the annotations plot and legend when a chart has annotations but doesn't have any values in the series. Fixes elastic#66981.
- Loading branch information
Showing
3 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
x-pack/plugins/apm/public/components/shared/charts/CustomPlot/CustomPlot.stories.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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
import { storiesOf } from '@storybook/react'; | ||
import React from 'react'; | ||
// @ts-ignore | ||
import CustomPlot from './'; | ||
|
||
storiesOf('shared/charts/CustomPlot', module).add( | ||
'with annotations but no data', | ||
() => { | ||
const annotations = [ | ||
{ | ||
type: 'version', | ||
id: '2020-06-10 04:36:31', | ||
'@timestamp': 1591763925012, | ||
text: '2020-06-10 04:36:31', | ||
}, | ||
{ | ||
type: 'version', | ||
id: '2020-06-10 15:23:01', | ||
'@timestamp': 1591802689233, | ||
text: '2020-06-10 15:23:01', | ||
}, | ||
]; | ||
return <CustomPlot annotations={annotations} series={[]} />; | ||
}, | ||
{ | ||
info: { | ||
source: false, | ||
text: | ||
"When a chart has no data but does have annotations, the annotations shouldn't show up at all.", | ||
}, | ||
} | ||
); |
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