-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: [DI-21463] - Added capability to transform area chart into line chart #11136
Changes from 3 commits
6d6e197
2ee3252
da99a81
752fa19
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Added | ||
--- | ||
|
||
Add hideFill & fillOpacity property to AreaChart component ([#11136](https://github.com/linode/manager/pull/11136)) | ||
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -9,15 +9,13 @@ import { | |||||||||||||
Legend, | ||||||||||||||
ResponsiveContainer, | ||||||||||||||
Tooltip, | ||||||||||||||
TooltipProps, | ||||||||||||||
XAxis, | ||||||||||||||
YAxis, | ||||||||||||||
} from 'recharts'; | ||||||||||||||
|
||||||||||||||
import { AccessibleAreaChart } from 'src/components/AreaChart/AccessibleAreaChart'; | ||||||||||||||
import { Box } from 'src/components/Box'; | ||||||||||||||
import MetricsDisplay from 'src/components/LineGraph/MetricsDisplay'; | ||||||||||||||
import { MetricsDisplayRow } from 'src/components/LineGraph/MetricsDisplay'; | ||||||||||||||
import { Paper } from 'src/components/Paper'; | ||||||||||||||
import { StyledBottomLegend } from 'src/features/NodeBalancers/NodeBalancerDetail/NodeBalancerSummary/TablesPanel'; | ||||||||||||||
|
||||||||||||||
|
@@ -27,6 +25,9 @@ import { | |||||||||||||
tooltipValueFormatter, | ||||||||||||||
} from './utils'; | ||||||||||||||
|
||||||||||||||
import type { TooltipProps } from 'recharts'; | ||||||||||||||
import type { MetricsDisplayRow } from 'src/components/LineGraph/MetricsDisplay'; | ||||||||||||||
|
||||||||||||||
interface AreaProps { | ||||||||||||||
color: string; | ||||||||||||||
dataKey: string; | ||||||||||||||
|
@@ -41,7 +42,9 @@ interface AreaChartProps { | |||||||||||||
areas: AreaProps[]; | ||||||||||||||
ariaLabel: string; | ||||||||||||||
data: any; | ||||||||||||||
fillOpacity?: number; | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optional: add jsdoc style comments to our props describing what they do |
||||||||||||||
height: number; | ||||||||||||||
hideFill?: boolean; | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nikhagra-akamai Yea let's do this, I have a feeling we'll want this. |
||||||||||||||
legendRows?: Omit<MetricsDisplayRow[], 'handleLegendClick'>; | ||||||||||||||
showLegend?: boolean; | ||||||||||||||
timezone: string; | ||||||||||||||
|
@@ -54,7 +57,9 @@ export const AreaChart = (props: AreaChartProps) => { | |||||||||||||
areas, | ||||||||||||||
ariaLabel, | ||||||||||||||
data, | ||||||||||||||
fillOpacity, | ||||||||||||||
height, | ||||||||||||||
hideFill, | ||||||||||||||
legendRows, | ||||||||||||||
showLegend, | ||||||||||||||
timezone, | ||||||||||||||
|
@@ -190,6 +195,7 @@ export const AreaChart = (props: AreaChartProps) => { | |||||||||||||
<Area | ||||||||||||||
dataKey={dataKey} | ||||||||||||||
fill={color} | ||||||||||||||
fillOpacity={hideFill ? 0 : fillOpacity ?? 1} | ||||||||||||||
hide={activeSeries.includes(dataKey)} | ||||||||||||||
isAnimationActive={false} | ||||||||||||||
key={dataKey} | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.