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);
}
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);
}
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());
}
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);
}
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));
}
}
Aggregations