@@ -88,11 +88,10 @@ export function GenericMetricsChart(props: {
88
88
display = "flex"
89
89
justifyContent = "space-around"
90
90
alignItems = "center"
91
- style = { { marginBottom : '1rem' , maxWidth : '900px ' } }
91
+ style = { { marginBottom : '1rem' , margin : '0 auto' , width : '0 ' } }
92
92
>
93
93
{ state === prometheusState . INSTALLED
94
94
? [
95
- < Box > </ Box > , // This Box is just for leveling the buttons alignment
96
95
< ToggleButtonGroup
97
96
onChange = { handleChartVariantChange }
98
97
size = "small"
@@ -120,39 +119,37 @@ export function GenericMetricsChart(props: {
120
119
</ Box >
121
120
122
121
{ prometheusInfo ? (
123
- < Box style = { { justifyContent : 'center' , display : 'flex' } } >
124
- < Box container spacing = { 2 } style = { { height : '40vh' , width : '80%' } } >
125
- { chartVariant === 'cpu' && (
126
- < CPUChart
127
- query = { props . cpuQuery }
128
- autoRefresh = { refresh }
129
- prometheusPrefix = { `${ prometheusInfo . podNamespace } /pods/${ prometheusInfo . podName } ` }
130
- />
131
- ) }
132
- { chartVariant === 'memory' && (
133
- < MemoryChart
134
- query = { props . memoryQuery }
135
- autoRefresh = { refresh }
136
- prometheusPrefix = { `${ prometheusInfo . podNamespace } /pods/${ prometheusInfo . podName } ` }
137
- />
138
- ) }
139
- { chartVariant === 'network' && (
140
- < NetworkChart
141
- rxQuery = { props . networkRxQuery }
142
- txQuery = { props . networkTxQuery }
143
- autoRefresh = { refresh }
144
- prometheusPrefix = { `${ prometheusInfo . podNamespace } /pods/${ prometheusInfo . podName } ` }
145
- />
146
- ) }
147
- { chartVariant === 'filesystem' && (
148
- < FilesystemChart
149
- readQuery = { props . filesystemReadQuery }
150
- writeQuery = { props . filesystemWriteQuery }
151
- autoRefresh = { refresh }
152
- prometheusPrefix = { `${ prometheusInfo . podNamespace } /pods/${ prometheusInfo . podName } ` }
153
- />
154
- ) }
155
- </ Box >
122
+ < Box style = { { justifyContent : 'center' , display : 'flex' , height : '40vh' , width : '80%' , margin : '0 auto' } } >
123
+ { chartVariant === 'cpu' && (
124
+ < CPUChart
125
+ query = { props . cpuQuery }
126
+ autoRefresh = { refresh }
127
+ prometheusPrefix = { `${ prometheusInfo . podNamespace } /pods/${ prometheusInfo . podName } ` }
128
+ />
129
+ ) }
130
+ { chartVariant === 'memory' && (
131
+ < MemoryChart
132
+ query = { props . memoryQuery }
133
+ autoRefresh = { refresh }
134
+ prometheusPrefix = { `${ prometheusInfo . podNamespace } /pods/${ prometheusInfo . podName } ` }
135
+ />
136
+ ) }
137
+ { chartVariant === 'network' && (
138
+ < NetworkChart
139
+ rxQuery = { props . networkRxQuery }
140
+ txQuery = { props . networkTxQuery }
141
+ autoRefresh = { refresh }
142
+ prometheusPrefix = { `${ prometheusInfo . podNamespace } /pods/${ prometheusInfo . podName } ` }
143
+ />
144
+ ) }
145
+ { chartVariant === 'filesystem' && (
146
+ < FilesystemChart
147
+ readQuery = { props . filesystemReadQuery }
148
+ writeQuery = { props . filesystemWriteQuery }
149
+ autoRefresh = { refresh }
150
+ prometheusPrefix = { `${ prometheusInfo . podNamespace } /pods/${ prometheusInfo . podName } ` }
151
+ />
152
+ ) }
156
153
</ Box >
157
154
) : state === prometheusState . LOADING ? (
158
155
< Box m = { 2 } >
@@ -298,6 +295,7 @@ export function CPUChart(props: { query: string; prometheusPrefix: string; autoR
298
295
299
296
const YTickProps = {
300
297
domain : [ 'dataMin' , 'auto' ] ,
298
+ width : 80 ,
301
299
} ;
302
300
303
301
return (
@@ -352,11 +350,12 @@ export function MemoryChart(props: {
352
350
domain : [ 'dataMin' , 'auto' ] ,
353
351
tick : ( { x, y, payload } ) => (
354
352
< g transform = { `translate(${ x } ,${ y } )` } fill = { theme . palette . chartStyles . labelColor } >
355
- < text x = { - 25 } y = { 0 } dy = { 0 } textAnchor = "middle" >
353
+ < text x = { - 35 } y = { 0 } dy = { 0 } textAnchor = "middle" >
356
354
{ formatBytes ( payload . value ) }
357
355
</ text >
358
356
</ g >
359
357
) ,
358
+ width : 80 ,
360
359
} ;
361
360
362
361
return (
@@ -429,11 +428,12 @@ export function NetworkChart(props: {
429
428
domain : [ 'dataMin' , 'auto' ] ,
430
429
tick : ( { x, y, payload } ) => (
431
430
< g transform = { `translate(${ x } ,${ y } )` } fill = { theme . palette . chartStyles . labelColor } >
432
- < text x = { - 25 } y = { 0 } dy = { 0 } textAnchor = "middle" >
431
+ < text x = { - 35 } y = { 0 } dy = { 0 } textAnchor = "middle" >
433
432
{ formatBytes ( payload . value ) }
434
433
</ text >
435
434
</ g >
436
435
) ,
436
+ width : 80 ,
437
437
} }
438
438
fetchMetrics = { fetchMetrics }
439
439
CustomTooltip = { CustomTooltipFormatBytes }
@@ -492,11 +492,12 @@ export function FilesystemChart(props: {
492
492
domain : [ 'dataMin' , 'auto' ] ,
493
493
tick : ( { x, y, payload } ) => (
494
494
< g transform = { `translate(${ x } ,${ y } )` } fill = { theme . palette . chartStyles . labelColor } >
495
- < text x = { - 25 } y = { 0 } dy = { 0 } textAnchor = "middle" >
495
+ < text x = { - 35 } y = { 0 } dy = { 0 } textAnchor = "middle" >
496
496
{ formatBytes ( payload . value ) }
497
497
</ text >
498
498
</ g >
499
499
) ,
500
+ width : 80 ,
500
501
} }
501
502
fetchMetrics = { fetchMetrics }
502
503
CustomTooltip = { CustomTooltipFormatBytes }
0 commit comments