Search in sources :

Example 26 with SolidColor

use of com.vaadin.addon.charts.model.style.SolidColor in project charts by vaadin.

the class ChartTypes method chartTypesSolidGaugeConfSnippet2.

public void chartTypesSolidGaugeConfSnippet2() {
    Chart chart = new Chart(ChartType.SOLIDGAUGE);
    Configuration conf = chart.getConfiguration();
    Pane pane = conf.getPane();
    Background bkg = new Background();
    // Gray
    bkg.setBackgroundColor(new SolidColor("#eeeeee"));
    // To make it an arc and not circle
    bkg.setInnerRadius("60%");
    // Default - not necessary
    bkg.setOuterRadius("100%");
    // solid or arc
    bkg.setShape("arc");
    pane.setBackground(bkg);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) Background(com.vaadin.addon.charts.model.Background) SolidColor(com.vaadin.addon.charts.model.style.SolidColor) Pane(com.vaadin.addon.charts.model.Pane) Chart(com.vaadin.addon.charts.Chart)

Example 27 with SolidColor

use of com.vaadin.addon.charts.model.style.SolidColor in project charts by vaadin.

the class BasicUse method basicUse3dDistanceSnippet2.

public void basicUse3dDistanceSnippet2() {
    double x = 3.2;
    double z = 3.3;
    double y = 2.3;
    Options3d options3d = new Options3d();
    DataSeriesItem3d item = new DataSeriesItem3d(x, y, z * options3d.getDepth().doubleValue());
    double distance = 43.2;
    // Grayness
    int gr = (int) (distance * 75);
    Marker marker = new Marker(true);
    marker.setRadius(1 + 10 / distance);
    marker.setFillColor(new SolidColor(gr, gr, gr));
    item.setMarker(marker);
    DataSeries series = new DataSeries();
    series.add(item);
}
Also used : DataSeriesItem3d(com.vaadin.addon.charts.model.DataSeriesItem3d) SolidColor(com.vaadin.addon.charts.model.style.SolidColor) DataSeries(com.vaadin.addon.charts.model.DataSeries) Marker(com.vaadin.addon.charts.model.Marker) Options3d(com.vaadin.addon.charts.model.Options3d)

Example 28 with SolidColor

use of com.vaadin.addon.charts.model.style.SolidColor in project charts by vaadin.

the class Sparkline method configureAsSparkline.

protected void configureAsSparkline() {
    getConfiguration().setTitle("");
    getConfiguration().setLegend(new Legend(false));
    getConfiguration().getChart().setBackgroundColor(new SolidColor(0, 0, 0, 0));
    getConfiguration().getChart().setMargin(0);
    Series series = getConfiguration().getSeries().get(0);
    PlotOptionsLine options = new PlotOptionsLine();
    options.setEnableMouseTracking(false);
    options.setMarker(new Marker(false));
    options.setShowInLegend(false);
    options.setAnimation(false);
    options.setShadow(false);
    series.setPlotOptions(options);
    configureXAxis(getConfiguration().getxAxis());
    configureYAxis(getConfiguration().getyAxis());
}
Also used : ListSeries(com.vaadin.addon.charts.model.ListSeries) Series(com.vaadin.addon.charts.model.Series) Legend(com.vaadin.addon.charts.model.Legend) PlotOptionsLine(com.vaadin.addon.charts.model.PlotOptionsLine) SolidColor(com.vaadin.addon.charts.model.style.SolidColor) Marker(com.vaadin.addon.charts.model.Marker)

Example 29 with SolidColor

use of com.vaadin.addon.charts.model.style.SolidColor in project charts by vaadin.

the class Sparkline method configureXAxis.

protected void configureXAxis(XAxis axis) {
    axis.setLineWidth(0);
    axis.setMinorGridLineWidth(0);
    axis.setMinorTickLength(0);
    axis.setMinorTickWidth(0);
    axis.setGridLineWidth(0);
    axis.setMaxPadding(0.1);
    axis.setMinPadding(0.1);
    axis.setLabels(new Labels(false));
    axis.setLineColor(new SolidColor(0, 0, 0, 0));
    axis.setTitle("");
    axis.setStartOnTick(false);
    axis.setEndOnTick(false);
}
Also used : SolidColor(com.vaadin.addon.charts.model.style.SolidColor) Labels(com.vaadin.addon.charts.model.Labels)

Example 30 with SolidColor

use of com.vaadin.addon.charts.model.style.SolidColor in project charts by vaadin.

the class ColorFactory method addStops.

private static void addStops(GradientColor gradientColor, Element element) {
    Elements stops = element.getElementsByTag("stops");
    for (Element stop : stops) {
        double position = parseDoubleAttribute(stop, "position");
        String color = stop.attr("color");
        if (color == null || "".equals(color)) {
            throw new DesignException("No color defined in stops: " + stop);
        }
        gradientColor.addColorStop(position, new SolidColor(color));
    }
}
Also used : DesignException(com.vaadin.ui.declarative.DesignException) Element(org.jsoup.nodes.Element) SolidColor(com.vaadin.addon.charts.model.style.SolidColor) Elements(org.jsoup.select.Elements)

Aggregations

SolidColor (com.vaadin.addon.charts.model.style.SolidColor)82 Configuration (com.vaadin.addon.charts.model.Configuration)55 Chart (com.vaadin.addon.charts.Chart)54 YAxis (com.vaadin.addon.charts.model.YAxis)40 DataSeries (com.vaadin.addon.charts.model.DataSeries)27 ListSeries (com.vaadin.addon.charts.model.ListSeries)26 XAxis (com.vaadin.addon.charts.model.XAxis)26 AxisTitle (com.vaadin.addon.charts.model.AxisTitle)25 DataSeriesItem (com.vaadin.addon.charts.model.DataSeriesItem)19 DataLabels (com.vaadin.addon.charts.model.DataLabels)18 Legend (com.vaadin.addon.charts.model.Legend)17 GradientColor (com.vaadin.addon.charts.model.style.GradientColor)15 Marker (com.vaadin.addon.charts.model.Marker)14 Tooltip (com.vaadin.addon.charts.model.Tooltip)14 Style (com.vaadin.addon.charts.model.style.Style)14 Labels (com.vaadin.addon.charts.model.Labels)12 PlotOptionsColumn (com.vaadin.addon.charts.model.PlotOptionsColumn)11 Random (java.util.Random)10 PlotOptionsArea (com.vaadin.addon.charts.model.PlotOptionsArea)9 PlotOptionsSpline (com.vaadin.addon.charts.model.PlotOptionsSpline)8