|
graph lines are hidden by my grid lines |
Posted by Norm on Sep-04-2022 00:34 |
|
I have a small problem, it's that my graph lines (pink orange and blue)are hidden by my red grid lines, what is a solution ?
Thanks
Photo #1 it original image and images #2, #3 and #4 are zoomed :
|
Re: graph lines are hidden by my grid lines |
Posted by Peter Kwan on Sep-05-2022 16:18 |
|
Hi Norm,
For an XYChart, by default, the grid lines stay behind all the layers. For your case, I can think of several possibilities:
(a) Your code may have used Layer.moveBack to put a layer behind the grid lines, or or PlotArea.moveGridBefore to put the grid lines in front of a layer.
(b) The red lines may not be grid lines. Grid lines are lines added to the chart at the position of the major ticks on the axes. Their colors can be set in XYChart.setPlotArea or PlotArea.setGridColor. There are another kind of horizontal lines called mark lines (added using Axis.addMark). These lines by default are on top of all layers. This can be configured using Mark.setDrawOnTop
To confirm if the lines are grid lines, please try to change its color a unique color (such as orange FF8844). Please check what API do you use. This can help to confirm if they are grid lines.
(c) The thinks behind the grid lines may not belong to the chart that draws the grid line. It is possible to overlay two charts together by using a MultiChart, or by DreaArea.merge. In this case, the bottom chart will be behind the grid lines of the top chart.
If you need further help, is it possible to provide an example code that can illustrate the problem? That can help me understand how the grid lines get in front of the layers.
Best Regards
Peter Kwan |
Re: graph lines are hidden by my grid lines |
Posted by Norm on Sep-05-2022 21:33 |
|
Peter,
You are right, to force the grid to appear over the orange color I had to put this in my code:
Call c.getPlotArea().moveGridBefore(layer)
Finally, to resolve my problem for pink line and a blue line I add this :
Call layerblue.moveFront(layer)
Call layerpink.moveFront(layer)
Problem solved, Thanks |
|