This example extends the Simple Bar Chart (1) example to demonstrates various methods to control the chart appearance and to add titles.
- Use BaseChart.setColor to configure the default text color (TextColor) to dark grey (333333) to reduce the contrast for a softer style. It also demonstrates using the transparent color to disable drawing parts of the chart, such as the bar and plot area border.
- Use XYChart.setPlotArea to configure the plot area to have transparent border and light grey (CCCCCC) grid lines.
- Use BaseChart.addTitle and Axis.setTitle to add chart and axis titles.
- Use Axis.setColors to set the axis stem and ticks to Transparent.
- Use Axis.setLabelStyle to set the label style to grey 12pt Arial.
- Use XYChart.addBarLayer to add a bar layer with light navy blue color (6699BB).
- Use Layer.setBorderColor to configure the border color to Transparent to disable the bar border.
- Use Axis.setTickDensity to configure a minimum label spacing for automatically generated labels. Although a chart will be more precise with more axis labels so long as they do not overlap, sometimes less labels are desirable for aesthetic reasons. Setting the minimum label spacing can control the label density without knowing how many labels would be produced (which depends on actual data).