Package com.vaadin.addon.charts.model.style

Examples of com.vaadin.addon.charts.model.style.SolidColor


public class GridTheme extends HighChartsDefaultTheme {

    public final static String FONT_FAMILIES = "\"Trebuchet MS\", Verdana, sans-serif";

    public GridTheme() {
        setColors(new SolidColor("#058DC7"), new SolidColor("#50B432"),
                new SolidColor("#ED561B"), new SolidColor("#DDDF00"),
                new SolidColor("#24CBE5"), new SolidColor("#64E572"),
                new SolidColor("#FF9655"), new SolidColor("#FFF263"),
                new SolidColor("#6AF9C4"));

        Style style = new Style();
        style.setFontFamily(FONT_FAMILIES);
        style.setFontSize("12px");
        getChart().setStyle(style);

        getChart().setPlotBackgroundColor(new SolidColor(255, 255, 255, .9));
        getChart().setPlotShadow(true);
        getChart().setPlotBorderWidth(1);

        getTitle().setColor(new SolidColor("#000"));
        getTitle().setFontSize("16px");
        getTitle().setFontWeight(FontWeight.BOLD);

        getSubtitle().setColor(new SolidColor("#666666"));
        getSubtitle().setFontWeight(FontWeight.BOLD);

        getxAxis().setGridLineWidth(1);
        getxAxis().setLineColor(new SolidColor("#000"));
        getxAxis().setTickColor(new SolidColor("#000"));
        getxAxis().getLabels().setColor(new SolidColor("#000"));
        getxAxis().getLabels().setFontSize("11px");
        getxAxis().getTitle().setColor(new SolidColor("#333"));
        getxAxis().getTitle().setFontWeight(FontWeight.BOLD);

        getyAxis().setMinorTickInterval(TickIntervalStyle.AUTO);
        getyAxis().setLineColor(new SolidColor("#000"));
        getyAxis().setLineWidth(1);
        getyAxis().setTickWidth(1);
        getyAxis().setTickColor(new SolidColor("#000"));
        getyAxis().getLabels().setColor(new SolidColor("#000"));
        getyAxis().getLabels().setFontSize("11px");
        getyAxis().getTitle().setColor(new SolidColor("#333"));
        getyAxis().getTitle().setFontWeight(FontWeight.BOLD);

        getLegend().getItemStyle().setColor(new SolidColor("black"));

        getLegend().getItemHoverStyle().setColor(new SolidColor("#039"));

        getLegend().getItemHiddenStyle().setColor(new SolidColor("gray"));

        getLabels().setColor(new SolidColor("#99b"));
       
        /* Shadows on by default, off in range stuff */
        getPlotOptions().getArearange().setShadow(false);
        getPlotOptions().getAreasplinerange().setShadow(false);
       
View Full Code Here


public class GrayTheme extends HighChartsDefaultTheme {

    public final static String FONT_FAMILIES = "Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif";

    public GrayTheme() {
        setColors(new SolidColor("#DDDF0D"), new SolidColor("#7798BF"),
                new SolidColor("#55BF3B"), new SolidColor("#DF5353"),
                new SolidColor("#aaeeee"), new SolidColor("#ff0066"),
                new SolidColor("#eeaaee"), new SolidColor("#55BF3B"),
                new SolidColor("#DF5353"), new SolidColor("#7798BF"),
                new SolidColor("#aaeeee"));

        Style style = new Style();
        style.setFontFamily(FONT_FAMILIES);
        style.setFontSize("12px");
        getChart().setStyle(style);

        GradientColor bgColor = GradientColor.createLinear(0, 0, 0, 400);
        bgColor.addColorStop(0, new SolidColor(96, 96, 96));
        bgColor.addColorStop(1, new SolidColor(16, 16, 16));
        getChart().setBackgroundColor(bgColor);
        getChart().setBorderWidth(0);
        getChart().setBorderRadius(15);
        // No need to set plotbackgroundcolor to null
        getChart().setPlotShadow(false);
        getChart().setPlotBorderWidth(0);

        getTitle().setColor(new SolidColor("#FFF"));
        getTitle().setFontSize("16px");

        getSubtitle().setColor(new SolidColor("#DDD"));

        getxAxis().setGridLineWidth(0);
        getxAxis().setLineColor(new SolidColor("#999"));
        getxAxis().setTickColor(new SolidColor("#999"));
        getxAxis().getLabels().setColor(new SolidColor("#999"));
        getxAxis().getLabels().setFontWeight(FontWeight.BOLD);

        getxAxis().getTitle().setColor(new SolidColor("#AAA"));
        getxAxis().getTitle().setFontWeight(FontWeight.BOLD);

        // No need to set alternative grid color to null
        // No need to set minor tick interval to null
        getyAxis().setGridLineColor(new SolidColor(255, 255, 255, .1));
        getyAxis().setLineWidth(0);
        getyAxis().setTickWidth(0);
        getyAxis().getLabels().setColor(new SolidColor("#999"));
        getyAxis().getLabels().setFontWeight(FontWeight.BOLD);
        getyAxis().getTitle().setColor(new SolidColor("#AAA"));
        getyAxis().getTitle().setFontWeight(FontWeight.BOLD);

        getLegend().getItemStyle().setColor(new SolidColor("#CCC"));

        getLegend().getItemHoverStyle().setColor(new SolidColor("#FFF"));

        getLegend().getItemHiddenStyle().setColor(new SolidColor("#333"));

        getLabels().setColor(new SolidColor("#CCC"));

        GradientColor tooltipBgColor = GradientColor.createLinear(0, 0, 0, 50);
        tooltipBgColor.addColorStop(0, new SolidColor(96, 96, 96, .8));
        tooltipBgColor.addColorStop(1, new SolidColor(16, 16, 16, .8));
        getTooltip().setBackgroundColor(tooltipBgColor);
        getTooltip().setBorderWidth(0);
        getTooltip().getStyle().setColor(new SolidColor("#FFF"));

       
        /* Shadows on by default, off in range stuff */
        getPlotOptions().getArearange().setShadow(false);
        getPlotOptions().getAreasplinerange().setShadow(false);
View Full Code Here

    private static final SolidColor PLOT_BORDER_COLOR = new SolidColor(
            "#C0C0C0");

    public HighChartsDefaultTheme() {

        setColors(new SolidColor("#2f7ed8"), new SolidColor("#0d233a"),
                new SolidColor("#8bbc21"), new SolidColor("#910000"),
                new SolidColor("#1aadce"), new SolidColor("#492970"),
                new SolidColor("#f28f43"), new SolidColor("#77a1e5"),
                new SolidColor("#c42525"), new SolidColor("#a6c96a"));

        Style style = new Style();
        style.setFontFamily(DEFAULT_FONT);
        style.setFontSize("12px");
        getChart().setStyle(style);

        getChart().setClassName("");
        getChart().setPlotBackgroundImage("");
        getChart().setPlotBackgroundColor(new SolidColor(255, 255, 255, 0.0));
        getChart().setBackgroundColor(new SolidColor("#FFFFFF"));
        getChart().setPlotBorderColor(PLOT_BORDER_COLOR);
        getChart().setPlotShadow(false);
        getChart().setPlotBorderWidth(0);

        getTitle().setColor(TITLE_FONT_COLOR);
        getTitle().setFontSize("16px");
        getTitle().setFontWeight(FontWeight.NORMAL);

        getSubtitle().setColor(new SolidColor("#6D869F"));
        getSubtitle().setFontSize("12px");
        getSubtitle().setFontWeight(FontWeight.NORMAL);

        getCredits().setText("Highcharts.com");
        getCredits().setHref("http://www.highcharts.com/");

        setAxisDefaults(getxAxis());
        getxAxis().setGridLineWidth(0);

        setAxisDefaults(getyAxis());
        getyAxis().setLineWidth(0);

        getyAxis().setGridLineWidth(1);
        getyAxis().setTickWidth(0);
        getyAxis().setMinorTickInterval(TickIntervalStyle.NONE);

        getTooltip().setBackgroundColor(new SolidColor(255, 255, 255, 0.85));
        getTooltip().setBorderWidth(2);
        getTooltip().getStyle().setColor(new SolidColor("#333333"));

        getLegend().setBorderRadius(5);
        getLegend().setBackgroundColor(new SolidColor(255, 255, 255, 0));
        getLegend().setBorderColor(GRAY2);
        getLegend().getItemStyle().setColor(TITLE_FONT_COLOR);
        getLegend().getItemStyle().setPosition(StylePosition.RELATIVE);

        getLegend().setItemHoverStyle(new Style());
        getLegend().getItemHoverStyle().setColor(new SolidColor("#000"));

        getLegend().setItemHiddenStyle(new Style());
        getLegend().getItemHiddenStyle().setColor(new SolidColor("#CCC"));
       
        getPlotOptions().getArearange().setShadow(false);
        getPlotOptions().getAreasplinerange().setShadow(false);
       
        getPlotOptions().getLine().setShadow(false);
View Full Code Here

    }

    protected void setAxisDefaults(AxisStyle style) {
        style.setGridLineColor(PLOT_BORDER_COLOR);
        style.setLineColor(new SolidColor("#C0D0E0"));
        style.setLineWidth(1);
        style.setTickColor(new SolidColor("#C0D0E0"));
        style.setAlternateGridColor(new SolidColor(255, 255, 255, 0.0));
        style.getTitle().setFontWeight(FontWeight.NORMAL);
        style.getTitle().setColor(TITLE_FONT_COLOR);
        style.getSubtitle().setFontSize("10px");
        style.getSubtitle().setFontWeight(FontWeight.NORMAL);
        style.getSubtitle().setColor(GRAY);
View Full Code Here

public class SkiesTheme extends HighChartsDefaultTheme {

    public static final String FONT_FAMILIES = "Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif";

    public SkiesTheme() {
        setColors(new SolidColor("#514F78"), new SolidColor("#42A07B"),
                new SolidColor("#9B5E4A"), new SolidColor("#72727F"),
                new SolidColor("#1F949A"), new SolidColor("#82914E"),
                new SolidColor("#86777F"), new SolidColor("#42A07B"));

        Style style = new Style();
        style.setFontFamily(FONT_FAMILIES);
        style.setFontSize("12px");
        getChart().setStyle(style);

        getChart().setClassName("skies");
        getChart().setBorderWidth(0);
        getChart().setPlotShadow(true);
        getChart().setPlotBackgroundImage(
                "http://www.highcharts.com/demo/gfx/skies.jpg");
        GradientColor bgColor = GradientColor.createLinear(0, 0, 0, 400);
        bgColor.addColorStop(0, new SolidColor(255, 255, 255, 1));
        bgColor.addColorStop(1, new SolidColor(255, 255, 255, 0));
        getChart().setBackgroundColor(bgColor);
        getChart().setPlotBorderWidth(1);

        getTitle().setColor(new SolidColor("#3E576F"));
        getTitle().setFontSize("16px");
        getTitle().setFontWeight(FontWeight.NORMAL);

        getSubtitle().setColor(new SolidColor("#6D869F"));
        getSubtitle().setFontWeight(FontWeight.NORMAL);

        getxAxis().setGridLineWidth(0);
        getxAxis().setLineColor(new SolidColor("#C0D0E0"));
        getxAxis().setTickColor(new SolidColor("#C0D0E0"));
        getxAxis().getLabels().setColor(new SolidColor("#666"));
        getxAxis().getLabels().setFontWeight(FontWeight.BOLD);
        getxAxis().getTitle().setColor(new SolidColor("#666"));

        getyAxis().setAlternateGridColor(new SolidColor(255, 255, 255, .5));
        getyAxis().setLineColor(new SolidColor("#C0D0E0"));
        getyAxis().setTickColor(new SolidColor("#C0D0E0"));
        getyAxis().setTickWidth(1);
        getyAxis().getLabels().setColor(new SolidColor("#666"));
        getyAxis().getLabels().setFontWeight(FontWeight.BOLD);
        getyAxis().getTitle().setColor(new SolidColor("#666"));

        getLegend().getItemStyle().setColor(new SolidColor("#3E576F"));

        getLegend().getItemHoverStyle().setColor(new SolidColor("black"));

        getLegend().getItemHiddenStyle().setColor(new SolidColor("silver"));

        getLabels().setColor(new SolidColor("#3E576F"));
       
        /* Shadows on by default, off in range stuff */
        getPlotOptions().getArearange().setShadow(false);
        getPlotOptions().getAreasplinerange().setShadow(false);
       
View Full Code Here

        setAxisDefaults(getxAxis());

        setAxisDefaults(getyAxis());

        getTooltip().setBackgroundColor(new SolidColor(255, 255, 255));
        getTooltip().setBorderWidth(1);
        getTooltip().setBorderRadius(BORDER_RADIUS);
        getTooltip().getStyle().setColor(TITLE_COLOR);

        getLegend().getItemStyle().setColor(LEGEND_TEXT_COLOR);
        Style itemHoverStyle = new Style();
        itemHoverStyle.setColor(new SolidColor(0, 0, 0));
        getLegend().setItemHoverStyle(itemHoverStyle);
        getLegend().setItemHiddenStyle(new Style());
        getLegend().getItemHiddenStyle()
                .setColor(new SolidColor(128, 128, 128));
        getLegend().setBorderRadius(BORDER_RADIUS);
        getLegend().setBorderColor(LINE_COLOR);
        getLegend().setBackgroundColor(BGCOLOR_LIGHT_GRAY);

        getLabels().setColor(TEXT_COLOR);

        getCredits().setStyle(new Style());
        getCredits().getStyle().setFontSize("10px");
        getCredits().getStyle().setColor(new SolidColor(128, 128, 128));
        getCredits().setText("Vaadin Charts");
        getCredits().setHref("https://vaadin.com/add-ons/charts");

        getyAxis().setMinorTickInterval(TickIntervalStyle.NONE);
        getyAxis().setAlternateGridColor(BGCOLOR_LIGHT_GRAY);
View Full Code Here

    protected void setAxisDefaults(AxisStyle style) {
        style.setGridLineColor(GRID_COLOR);
        style.setLineColor(GRID_COLOR);
        style.setLineWidth(1);
        style.setTickColor(GRID_COLOR);
        style.setAlternateGridColor(new SolidColor(255, 255, 255, 0.0));

        style.getTitle().setColor(TITLE_COLOR);
        style.getTitle().setFontWeight(FontWeight.BOLD);

        style.getSubtitle().setColor(SUBTITLE_COLOR);
View Full Code Here

    /**
     * Sets the background color of the legend, filling the rounded corner
     * border. Defaults to null.
     */
    public void setBackgroundColor(String backgroundColor) {
        this.backgroundColor = new SolidColor(backgroundColor);
    }
View Full Code Here

     * Sets the color of the border drawn around the legend.
     *
     * @param borderColor
     */
    public void setBorderColor(String borderColor) {
        this.borderColor = new SolidColor(borderColor);
    }
View Full Code Here

TOP

Related Classes of com.vaadin.addon.charts.model.style.SolidColor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.