@@ -95,6 +95,7 @@ const BarGraph = props => {
95
95
let i = 0 ;
96
96
// let barWidth = (xMax / (Object.keys(data.barStack[0]).length) + 5);
97
97
const barWidth = ( xMax * ( 2 / 3 ) / ( Object . keys ( data . barStack [ 0 ] ) . length - 2 ) ) ;
98
+ console . log ( barWidth , '<-- barWidth' )
98
99
console . log ( data , '<-- data from snapshot' ) ;
99
100
// function colorGen() {
100
101
// const r = Math.floor(Math.random() * 256);
@@ -103,6 +104,8 @@ const BarGraph = props => {
103
104
// return "rgb(" + r + "," + g + "," + b + ", " + .5 + ")"
104
105
// }
105
106
const rgb = [ 'rgba(50, 100, 241, .5)' , 'rgba(90, 150, 217, .5)' , 'rgba(200, 30, 7, .5)' , 'rgba(23, 233, 217, .5)' , 'rgba(150, 227, 19, .5)' ] ;
107
+ const gap = xMax / ( Object . keys ( data . barStack [ 0 ] ) . length ) ;
108
+ console . log ( gap , i , '<-- gap , i' ) ;
106
109
for ( const [ key , value ] of Object . entries ( data . barStack [ 0 ] ) ) {
107
110
const toolTipData = { key : key , value : value }
108
111
console . log ( xMax , '<-- xmax' ) ;
@@ -114,9 +117,9 @@ const BarGraph = props => {
114
117
min = "outer min"
115
118
max = "first if"
116
119
// x={100}
117
- x = { xMax / ( Object . keys ( data . barStack [ 0 ] ) . length ) }
118
- y = { yMax - value }
119
- height = { value }
120
+ x = { gap }
121
+ y = { yMax - value * 25 }
122
+ height = { value * 25 }
120
123
key = { key }
121
124
width = { barWidth }
122
125
fill = "#62d6fb"
@@ -135,7 +138,8 @@ const BarGraph = props => {
135
138
dispatch ( onHover ( data . componentData [ key ] . rtid ) ) ;
136
139
if ( tooltipTimeout ) clearTimeout ( tooltipTimeout ) ;
137
140
const top = event . clientY - margin . top - value * 25 ;
138
- const left = 10 + 10 * i + barWidth * i + barWidth / 2 ;
141
+ // const left = 10 + 10 * i + barWidth * i + barWidth / 2;
142
+ const left = gap + barWidth / 2 ;
139
143
showTooltip ( {
140
144
tooltipData : toolTipData ,
141
145
tooltipTop : top ,
@@ -147,10 +151,10 @@ const BarGraph = props => {
147
151
BarArray . push ( < Bar
148
152
min = "outer min"
149
153
max = "else here"
150
- x = { ( xMax / ( Object . keys ( data . barStack [ 0 ] ) . length ) ) * ( i + 1 ) }
154
+ x = { gap * ( i + 1 ) }
151
155
// x={(xMax / (Object.keys(data.barStack[0]).length - 2)) + barWidth * i}
152
- y = { yMax - value * 20 }
153
- height = { value * 20 }
156
+ y = { yMax - value * 25 }
157
+ height = { value * 25 }
154
158
key = { key }
155
159
width = { barWidth }
156
160
fill = "#62d6fb"
@@ -169,7 +173,8 @@ const BarGraph = props => {
169
173
dispatch ( onHover ( data . componentData [ key ] . rtid ) ) ;
170
174
if ( tooltipTimeout ) clearTimeout ( tooltipTimeout ) ;
171
175
const top = event . clientY - margin . top - value * 25 ;
172
- const left = 10 + 10 * i + barWidth * i + barWidth / 2 ;
176
+ // const left = 10 + 10 * i + barWidth * i + barWidth / 2;
177
+ const left = gap * ( i + 1 ) + barWidth / 2 ;
173
178
showTooltip ( {
174
179
tooltipData : toolTipData ,
175
180
tooltipTop : top ,
@@ -555,11 +560,13 @@ const BarGraph = props => {
555
560
style = { tooltipStyles }
556
561
>
557
562
{ console . log ( tooltipData , '<------tooltipData' ) }
563
+ { console . log ( data . componentData , '<------data.componentData' ) }
558
564
< div style = { { color : colorScale ( tooltipData . key ) } } >
559
565
{ ' ' }
560
566
< strong > { tooltipData . key } </ strong >
561
567
{ ' ' }
562
568
</ div >
569
+ < div > { data . componentData [ tooltipData . key ] . stateType } </ div >
563
570
< div >
564
571
{ ' ' }
565
572
{ formatRenderTime ( tooltipData . value ) }
0 commit comments