-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Highcharts plugin): fix area trigger overlapping (#342)
- Loading branch information
Showing
4 changed files
with
139 additions
and
9 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
src/plugins/highcharts/__stories__/area/WithThreshold.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,57 @@ | ||
import React from 'react'; | ||
import {Meta, Story} from '@storybook/react'; | ||
import {ChartKit} from '../../../../components/ChartKit'; | ||
import type {HighchartsWidgetData} from '../../types'; | ||
import {ChartStory} from '../components/ChartStory'; | ||
|
||
export default { | ||
title: 'Plugins/Highcharts/Area', | ||
component: ChartKit, | ||
} as Meta; | ||
|
||
const data = { | ||
data: { | ||
graphs: [ | ||
{ | ||
data: [ | ||
29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, | ||
], | ||
}, | ||
], | ||
}, | ||
config: { | ||
hideHolidaysBands: true, | ||
}, | ||
libraryConfig: { | ||
chart: { | ||
type: 'area', | ||
}, | ||
plotOptions: { | ||
series: { | ||
threshold: 100, | ||
}, | ||
}, | ||
xAxis: { | ||
categories: [ | ||
'Jan', | ||
'Feb', | ||
'Mar', | ||
'Apr', | ||
'May', | ||
'Jun', | ||
'Jul', | ||
'Aug', | ||
'Sep', | ||
'Oct', | ||
'Nov', | ||
'Dec', | ||
], | ||
}, | ||
}, | ||
} as HighchartsWidgetData; | ||
|
||
const Template: Story<any> = () => { | ||
return <ChartStory data={data} height="300px" />; | ||
}; | ||
|
||
export const WithThreshold = Template.bind({}); |
82 changes: 82 additions & 0 deletions
82
src/plugins/highcharts/__stories__/combined/AreaLine.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,82 @@ | ||
import React from 'react'; | ||
import {Meta, Story} from '@storybook/react'; | ||
import {ChartKit} from '../../../../components/ChartKit'; | ||
import type {HighchartsWidgetData} from '../../types'; | ||
import {ChartStory} from '../components/ChartStory'; | ||
|
||
export default { | ||
title: 'Plugins/Highcharts/Combined Charts', | ||
component: ChartKit, | ||
} as Meta; | ||
|
||
const data = { | ||
data: { | ||
graphs: [ | ||
{ | ||
data: [29.9, 40, 30.4, 50, 60, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4], | ||
}, | ||
{ | ||
type: 'area', | ||
data: [ | ||
144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, | ||
], | ||
yAxis: 1, | ||
}, | ||
], | ||
}, | ||
config: { | ||
hideHolidaysBands: true, | ||
}, | ||
libraryConfig: { | ||
chart: { | ||
marginRight: 80, | ||
zoomType: 'xy', | ||
}, | ||
xAxis: { | ||
categories: [ | ||
'Jan', | ||
'Feb', | ||
'Mar', | ||
'Apr', | ||
'May', | ||
'Jun', | ||
'Jul', | ||
'Aug', | ||
'Sep', | ||
'Oct', | ||
'Nov', | ||
'Dec', | ||
], | ||
endOnTick: false, | ||
startOnTick: false, | ||
}, | ||
yAxis: [ | ||
{ | ||
lineWidth: 1, | ||
title: { | ||
text: 'Primary Axis', | ||
}, | ||
labels: { | ||
enabled: true, | ||
}, | ||
}, | ||
{ | ||
lineWidth: 1, | ||
opposite: true, | ||
title: { | ||
text: 'Secondary Axis', | ||
}, | ||
}, | ||
], | ||
tooltip: { | ||
shared: true, | ||
valueDecimals: 0, | ||
}, | ||
}, | ||
} as HighchartsWidgetData; | ||
|
||
const Template: Story<any> = () => { | ||
return <ChartStory data={data} />; | ||
}; | ||
|
||
export const AreaLine = Template.bind({}); |
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