|
1248 | 1248 | var pad = this.root_pad(), |
1249 | 1249 | h = this.frame_height(), |
1250 | 1250 | w = this.frame_width(), |
1251 | | - grid, grid_style = JSROOT.gStyle.fGridStyle, |
1252 | | - grid_color = (JSROOT.gStyle.fGridColor > 0) ? this.get_color(JSROOT.gStyle.fGridColor) : "black"; |
| 1251 | + grid, grid_style = JSROOT.gStyle.fGridStyle; |
1253 | 1252 |
|
1254 | 1253 | if ((grid_style < 0) || (grid_style >= JSROOT.Painter.root_line_styles.length)) grid_style = 11; |
1255 | 1254 |
|
|
1262 | 1261 | else |
1263 | 1262 | grid += "M"+this.x_handle.ticks[n]+",0v"+h; |
1264 | 1263 |
|
| 1264 | + var colid = (JSROOT.gStyle.fGridColor > 0) ? JSROOT.gStyle.fGridColor : (this.GetAxis("x") ? this.GetAxis("x").fAxisColor : 1), |
| 1265 | + grid_color = this.get_color(colid) || "black"; |
| 1266 | + |
1265 | 1267 | if (grid.length > 0) |
1266 | | - layer.append("svg:path") |
1267 | | - .attr("class", "xgrid") |
1268 | | - .attr("d", grid) |
1269 | | - .style('stroke',grid_color).style("stroke-width",JSROOT.gStyle.fGridWidth) |
1270 | | - .style("stroke-dasharray", JSROOT.Painter.root_line_styles[grid_style]); |
| 1268 | + layer.append("svg:path") |
| 1269 | + .attr("class", "xgrid") |
| 1270 | + .attr("d", grid) |
| 1271 | + .style('stroke',grid_color).style("stroke-width",JSROOT.gStyle.fGridWidth) |
| 1272 | + .style("stroke-dasharray", JSROOT.Painter.root_line_styles[grid_style]); |
1271 | 1273 | } |
1272 | 1274 |
|
1273 | 1275 | // add a grid on y axis, if the option is set |
|
1279 | 1281 | else |
1280 | 1282 | grid += "M0,"+this.y_handle.ticks[n]+"h"+w; |
1281 | 1283 |
|
| 1284 | + var colid = (JSROOT.gStyle.fGridColor > 0) ? JSROOT.gStyle.fGridColor : (this.GetAxis("y") ? this.GetAxis("y").fAxisColor : 1), |
| 1285 | + grid_color = this.get_color(colid) || "black"; |
| 1286 | + |
1282 | 1287 | if (grid.length > 0) |
1283 | | - layer.append("svg:path") |
1284 | | - .attr("class", "ygrid") |
1285 | | - .attr("d", grid) |
1286 | | - .style('stroke',grid_color).style("stroke-width",JSROOT.gStyle.fGridWidth) |
1287 | | - .style("stroke-dasharray", JSROOT.Painter.root_line_styles[grid_style]); |
| 1288 | + layer.append("svg:path") |
| 1289 | + .attr("class", "ygrid") |
| 1290 | + .attr("d", grid) |
| 1291 | + .style('stroke',grid_color).style("stroke-width",JSROOT.gStyle.fGridWidth) |
| 1292 | + .style("stroke-dasharray", JSROOT.Painter.root_line_styles[grid_style]); |
1288 | 1293 | } |
1289 | 1294 | } |
1290 | 1295 |
|
|
0 commit comments