Search in sources :

Example 1 with PlotBackgroundColor

use of org.opennms.netmgt.config.charts.PlotBackgroundColor in project opennms by OpenNMS.

the class ChartUtils method setPlotBackgroundColor.

private static void setPlotBackgroundColor(BarChart chartConfig, JFreeChart chart) {
    if (chartConfig.getPlotBackgroundColor().isPresent()) {
        final PlotBackgroundColor bgColor = chartConfig.getPlotBackgroundColor().get();
        if (bgColor.getRgb().isPresent()) {
            final Red red = bgColor.getRgb().get().getRed();
            final Blue blue = bgColor.getRgb().get().getBlue();
            final Green green = bgColor.getRgb().get().getGreen();
            chart.getPlot().setBackgroundPaint(new Color(red.getRgbColor(), green.getRgbColor(), blue.getRgbColor()));
        }
    }
}
Also used : PlotBackgroundColor(org.opennms.netmgt.config.charts.PlotBackgroundColor) Red(org.opennms.netmgt.config.charts.Red) Blue(org.opennms.netmgt.config.charts.Blue) Color(java.awt.Color) ChartBackgroundColor(org.opennms.netmgt.config.charts.ChartBackgroundColor) PlotBackgroundColor(org.opennms.netmgt.config.charts.PlotBackgroundColor) Green(org.opennms.netmgt.config.charts.Green)

Aggregations

Color (java.awt.Color)1 Blue (org.opennms.netmgt.config.charts.Blue)1 ChartBackgroundColor (org.opennms.netmgt.config.charts.ChartBackgroundColor)1 Green (org.opennms.netmgt.config.charts.Green)1 PlotBackgroundColor (org.opennms.netmgt.config.charts.PlotBackgroundColor)1 Red (org.opennms.netmgt.config.charts.Red)1