-
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.
chore: chore: Plot channel height data.
- Loading branch information
1 parent
463ca72
commit e9d47b1
Showing
4 changed files
with
22 additions
and
31 deletions.
There are no files selected for viewing
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
34 changes: 15 additions & 19 deletions
34
src/features/Results/CaseResult/CaseResultView/ObjectCaseResult/GraphPlot/GraphPlot.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 |
---|---|---|
@@ -1,50 +1,46 @@ | ||
/* eslint-disable max-lines-per-function */ | ||
import { GetObjectResultsDto } from '../../../../../../api/generated'; | ||
import { ReactECharts, ReactEChartsProps } from '../Echarts/ReactECharts'; | ||
|
||
export const GraphPlot = () => { | ||
export const GraphPlot = ({ data }: { data: GetObjectResultsDto }) => { | ||
const option: ReactEChartsProps['option'] = { | ||
dataset: { | ||
source: [ | ||
['Commodity', 'Owned', 'Financed'], | ||
['Commodity 1', 4, 1], | ||
['Commodity 2', 2, 4], | ||
['Commodity 3', 3, 6], | ||
['Commodity 4', 5, 3], | ||
], | ||
}, | ||
tooltip: { | ||
trigger: 'axis', | ||
axisPointer: { | ||
type: 'shadow', | ||
}, | ||
}, | ||
legend: { | ||
data: ['Owned', 'Financed'], | ||
data: ['Percentile', 'Value'], | ||
}, | ||
grid: { | ||
left: '10%', | ||
right: '0%', | ||
right: '10%', | ||
top: '20%', | ||
bottom: '20%', | ||
}, | ||
xAxis: { | ||
type: 'category', | ||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], | ||
type: 'value', | ||
}, | ||
yAxis: { | ||
type: 'value', | ||
type: 'category', | ||
data: Object.keys(data.height.percentiles), | ||
}, | ||
series: [ | ||
{ | ||
data: [150, 230, 224, 218, 135, 147, 260], | ||
name: 'Channel width (m)', | ||
type: 'line', | ||
data: Object.values(data.height.percentiles), | ||
}, | ||
], | ||
}; | ||
|
||
return ( | ||
<> | ||
<ReactECharts option={option} /> | ||
</> | ||
<div> | ||
<ReactECharts | ||
option={option} | ||
style={{ width: '100%', height: '350px' }} | ||
/> | ||
</div> | ||
); | ||
}; |
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