Skip to content

Commit

Permalink
fix(annotations): markers shown in empty chart (#358)
Browse files Browse the repository at this point in the history
closes #357
  • Loading branch information
nickofthyme authored Aug 28, 2019
1 parent 259fd14 commit 8dbf54e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/components/annotation_tooltips.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ class AnnotationTooltipComponent extends React.Component<AnnotationTooltipProps>
}

render() {
const { chartStore } = this.props;

if (chartStore!.isChartEmpty.get()) {
return null;
}

return (
<React.Fragment>
{this.renderAnnotationMarkers()}
Expand Down
2 changes: 1 addition & 1 deletion stories/annotations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ storiesOf('Annotations', module)

return (
<Chart className={'story-chart'}>
<Settings debug={boolean('debug', false)} rotation={chartRotation} />
<Settings showLegend debug={boolean('debug', false)} rotation={chartRotation} />
<LineAnnotation
annotationId={getAnnotationId('anno_1')}
domainType={AnnotationDomainTypes.XDomain}
Expand Down

0 comments on commit 8dbf54e

Please sign in to comment.