private void setGridAxisColors ( ro . nextreports . jofc2 . model . Chart flashChart , XAxis xAxis , YAxis yAxis ) { boolean isHorizontal = chart . getType ( ) . isHorizontal ( ) ; Color xGridColor = chart . getXGridColor ( ) ; Color yGridColor = chart . getYGridColor ( ) ; if ( xGridColor != null ) { getXAxis ( xAxis , yAxis , isHorizontal ) . setGridColour ( getHexColor ( xGridColor ) ) ; } if ( ( chart . getXShowGrid ( ) != null ) && ! chart . getXShowGrid ( ) ) { if ( flashChart . getBackgroundColour ( ) == null ) { getXAxis ( xAxis , yAxis , isHorizontal ) . setGridColour ( getHexColor ( DEFAULT_BACKGROUND ) ) ; } else { getXAxis ( xAxis , yAxis , isHorizontal ) . setGridColour ( flashChart . getBackgroundColour ( ) ) ; } } if ( yGridColor != null ) { getYAxis ( xAxis , yAxis , isHorizontal ) . setGridColour ( getHexColor ( yGridColor ) ) ; } if ( ( chart . getYShowGrid ( ) != null ) && ! chart . getYShowGrid ( ) ) { if ( flashChart . getBackgroundColour ( ) == null ) { getYAxis ( xAxis , yAxis , isHorizontal ) . setGridColour ( getHexColor ( DEFAULT_BACKGROUND ) ) ; } else { getYAxis ( xAxis , yAxis , isHorizontal ) . setGridColour ( flashChart . getBackgroundColour ( ) ) ; } } }
to hide a grid we set its color to chart background color