Skip to content

Commit 86808bf

Browse files
committed
fix: back off use of Tile wrapper around charts
the Tile title font does not scale, whereas the fonts in the chart do...
1 parent 20f1575 commit 86808bf

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"defaultTheme": "Tuatara"
2+
"defaultTheme": "PatternFly4 Dark"
33
}

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

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616

1717
import React from "react"
18-
import { Tile } from "@patternfly/react-core"
1918

2019
import {
2120
Chart,
@@ -69,15 +68,15 @@ export default class BaseChart extends React.PureComponent<Props> {
6968
private static tickLabelFontSize = BaseChart.fontSize - 1
7069

7170
private static readonly dimensions = {
72-
width: 120,
73-
height: 140,
71+
width: 140,
72+
height: 160,
7473
}
7574

7675
public static readonly padding = {
77-
bottom: BaseChart.fontSize * 1.5,
78-
top: BaseChart.fontSize * 4,
79-
left: BaseChart.fontSize * 3.5,
80-
right: BaseChart.fontSize * 4,
76+
bottom: BaseChart.fontSize * 3,
77+
top: BaseChart.fontSize * 5,
78+
left: BaseChart.fontSize * 4.5,
79+
right: BaseChart.fontSize * 4.5,
8180
}
8281

8382
public static readonly colors = [
@@ -124,7 +123,7 @@ export default class BaseChart extends React.PureComponent<Props> {
124123
private static axisLabelStyle(
125124
fill: string,
126125
fontSize = BaseChart.fontSize,
127-
fontStyle = "italic",
126+
fontStyle = "normal",
128127
fontWeight = 500
129128
): ChartLabelProps["style"] {
130129
return { fontSize, fontStyle, fontWeight, fill }
@@ -249,10 +248,21 @@ export default class BaseChart extends React.PureComponent<Props> {
249248
return this.lineStyle(stroke, "3,0.5", 2)
250249
}
251250

251+
private title(chart: BaseChartProps) {
252+
return (
253+
<ChartLabel
254+
x={BaseChart.titlePosition.x.left}
255+
y={BaseChart.fontSize * 1.5}
256+
style={BaseChart.titleStyle()}
257+
text={chart.title}
258+
/>
259+
)
260+
}
261+
252262
private chart(chart: BaseChartProps, idx: number) {
253263
// ariaTitle={chart.title}
254264
return (
255-
<Tile className="codeflare-chart-container" key={idx} title={chart.title}>
265+
<div className="codeflare-chart-container" key={idx}>
256266
<Chart
257267
ariaDesc={chart.desc}
258268
padding={chart.padding || BaseChart.padding}
@@ -273,6 +283,7 @@ export default class BaseChart extends React.PureComponent<Props> {
273283
/>
274284
}
275285
>
286+
{this.title(chart)}
276287
{this.xAxis()}
277288
{chart.series.flatMap(({ impl, stroke, fill = stroke, data }, idx) => {
278289
const yAxis =
@@ -308,7 +319,7 @@ export default class BaseChart extends React.PureComponent<Props> {
308319
}
309320
})}
310321
</Chart>
311-
</Tile>
322+
</div>
312323
)
313324
}
314325

plugins/plugin-codeflare/web/scss/components/Dashboard/Charts.scss

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,4 @@
2828

2929
@include ChartContainer {
3030
background-color: var(--color-base00);
31-
32-
&.pf-c-tile {
33-
padding-left: 1em;
34-
padding-right: 1em;
35-
--pf-c-tile__title--Color: var(--color-text-01);
36-
--pf-c-tile--before--BorderColor: var(--color-base00);
37-
}
3831
}

0 commit comments

Comments
 (0)