1515 */
1616
1717import React from "react"
18- import { Tile } from "@patternfly/react-core"
1918
2019import {
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
0 commit comments