Skip to content

Commit f039e58

Browse files
committed
fix: use slightly smaller stroke width in charts
also a small bit of code cleanup in that area
1 parent f8e2e26 commit f039e58

File tree

1 file changed

+6
-6
lines changed
  • plugins/plugin-codeflare/src/components

1 file changed

+6
-6
lines changed

plugins/plugin-codeflare/src/components/Chart.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,16 @@ export default class BaseChart extends React.PureComponent<Props> {
211211
}
212212
}
213213

214-
private areaStyle(stroke: string, fill: string, fillOpacity = 0.1): ChartAreaProps["style"] {
215-
return { data: { stroke, fill, fillOpacity } }
214+
private areaStyle(stroke: string, fill: string, strokeWidth = 1.25, fillOpacity = 0.1): ChartAreaProps["style"] {
215+
return { data: { stroke, strokeWidth, fill, fillOpacity } }
216216
}
217217

218-
private lineStyle(color: string, extra: Required<ChartLineProps>["style"]["data"] = {}): ChartLineProps["style"] {
219-
return { data: Object.assign({ stroke: color }, extra) }
218+
private lineStyle(stroke: string, strokeDasharray = "", strokeWidth = 1.25): ChartLineProps["style"] {
219+
return { data: { stroke, strokeWidth, strokeDasharray } }
220220
}
221221

222-
private lineDashStyle(color: string): ChartLineProps["style"] {
223-
return this.lineStyle(color, { strokeDasharray: "3,0.5" })
222+
private lineDashStyle(stroke: string): ChartLineProps["style"] {
223+
return this.lineStyle(stroke, "3,0.5", 2)
224224
}
225225

226226
private title(chart: BaseChartProps) {

0 commit comments

Comments
 (0)