Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
book-of-vaadin.pdf
Скачиваний:
88
Добавлен:
24.03.2015
Размер:
13.43 Mб
Скачать

Vaadin Charts

19.3.3. Chart Themes

The visual style and essentially any other chart configuration can be defined in a theme. The theme is global in the UI and can be set with the setTheme() in the thread-local ChartTheme singleton.

ChartTheme.get().setTheme(new SkiesTheme());

The VaadinTheme is the default chart theme in Vaadin Charts. Other available themes are GrayTheme, GridTheme, and SkiesTheme. The default theme in Highcharts can be set with the HighChartsDefaultTheme.

A theme is a Vaadin Charts configuration that is used as a template for the configuration when rendering the chart.

19.4. Chart Types

Vaadin Charts comes with over a dozen different chart types.You normally specify the chart type in the constructor of the Chart object. The available chart types are defined in the ChartType enum. You can later read or set the chart type with the chartType property of the chart model, which you can get with getConfiguration().getChart().

Each chart type has its specific plot options and support its specific collection of chart features. They also have specific requirements for the data series.

The basic chart types and their variants are covered in the following subsections.

19.4.1. Line and Spline Charts

Line charts connect the series of data points with lines. In the basic line charts the lines are straight, while in spline charts the lines are smooth polynomial interpolations between the data points.

Table 19.1. Line Chart Subtypes

ChartType

Plot Options Class

LINE

PlotOptionsLine

SPLINE

PlotOptionsSpline

Plot Options

The color property in the line plot options defines the line color, lineWidth the line width, and dashStyle the dash pattern for the lines.

See Section 19.4.4, “Scatter Charts” for plot options regarding markers and other data point properties. The markers can also be configured for each data point.

19.4.2. Area Charts

Area charts are like line charts, except that the area between the line and the Y axis is painted with a transparent color. In addition to the base type, chart type combinations for spline interpolation and ranges are supported.

Chart Themes

417

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]