
This example demostrates using a pattern for filling the area in an area chart, together with a number of chart formatting features.
- Create a XYChart object with background color and border using XYChart.XYChart.
- Set the background color of the title box using Box.setBackground. The background color is a pattern color created using BaseChart.patternColor.
- Enable both vertical and horizontal grid lines using XYChart.setPlotArea. The grid colors are dash line colors created using BaseChart.dashLineColor.
- Create a pattern color with a "snow pattern" loaded from an image file using BaseChart.patternColor2.
- Use DataSet.setDataColor to specify the area fill and border colors. Use the "snow pattern" as the area fill color.
- Use Layer.setLineWidth to increase the border width of the area to highlight it.