@@ -12,47 +12,6 @@ import {
1212 ReferenceLine ,
1313} from 'recharts' ;
1414
15- function ProjectLabel ( { viewBox, info } ) {
16- return (
17- < foreignObject
18- x = { viewBox . x + 60 }
19- y = { viewBox . y + 10 }
20- width = { 140 }
21- height = { 70 }
22- style = { { overflow : 'visible' } }
23- >
24- < div
25- style = { {
26- textAlign : 'left' ,
27- color : info . fontcolor ,
28- fontSize : 14 ,
29- background : 'white' ,
30- borderRadius : 4 ,
31- padding : 6 ,
32- boxShadow : '0 1px 4px #ccc' ,
33- lineHeight : 1.2 ,
34- border : '1px solid #eee' ,
35- minWidth : 120 ,
36- minHeight : 60 ,
37- pointerEvents : 'none' ,
38- display : 'grid' ,
39- justifyItems : 'center' ,
40- gap : 1 ,
41- } }
42- >
43- < div style = { { color : '#444' , fontWeight : 'bold' , fontSize : 15 } } > Projects</ div >
44- < div style = { { color : '#222' , fontWeight : 'bold' , fontSize : 14 } } > { info . amount } </ div >
45- < div style = { { color : '#666' , fontSize : 10 } } > ({ info . percentage } )</ div >
46- { info . ifcompare && (
47- < div style = { { color : info . fontcolor , fontSize : 10 , fontWeight : 'bold' } } >
48- { info . change }
49- </ div >
50- ) }
51- </ div >
52- </ foreignObject >
53- ) ;
54- }
55-
5615export default function TinyBarChart ( props ) {
5716 const {
5817 chartData,
@@ -65,12 +24,13 @@ export default function TinyBarChart(props) {
6524 } = props ;
6625
6726 return (
68- < ResponsiveContainer maxWidth = { 600 } maxHeight = { 400 } minWidth = { 180 } minHeight = { 340 } >
27+ < ResponsiveContainer width = "100%" height = "100%" maxHeight = { 400 } minWidth = { 180 } minHeight = { 340 } >
6928 < BarChart
7029 data = { chartData }
7130 margin = { {
7231 top : 50 ,
7332 bottom : 40 ,
33+ left : 40 ,
7434 right : 20 ,
7535 } }
7636 >
@@ -86,10 +46,11 @@ export default function TinyBarChart(props) {
8646 value : yAxisLabel ,
8747 angle : - 90 ,
8848 position : 'insideLeft' ,
89- offset : 20 ,
49+ offset : 5 ,
9050 fill : darkMode ? 'white' : '#444' ,
91- fontSize : 14 ,
51+ fontSize : 12 ,
9252 fontWeight : 'bold' ,
53+ style : { textAnchor : 'middle' } ,
9354 } }
9455 />
9556 < Tooltip content = { < CustomTooltip /> } cursor = { { fill : 'transparent' } } />
@@ -105,7 +66,6 @@ export default function TinyBarChart(props) {
10566 stroke = { darkMode ? 'lightgreen' : 'green' }
10667 strokeDasharray = "6 6"
10768 ifOverflow = "extendDomain"
108- label = { < ProjectLabel info = { projectBarInfo } /> }
10969 />
11070 ) }
11171 </ BarChart >
0 commit comments