Package org.openhab.core.sitemap
Interface Chart
- All Superinterfaces:
NonLinkableWidget,Widget
A representation of a sitemap Chart widget.
- Author:
- Mark Herwege - Initial contribution
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn true if the group item will be shown instead of items in the group.@Nullable StringGets the interpolation parameter.Get the configured chart time period.intGet the chart refresh interval in s.@Nullable StringGet the configured persistence service, if no service is configured, the default service should be used.@Nullable StringGet the y axis value format pattern.@Nullable BooleanReturn true if legend should be shown, false if it should not be shown, null if not explicitly set and it should be determined based on number of series in chart.voidsetForceAsItem(@Nullable Boolean forceAsItem) Set to true if group item should be shown in the chart instead of items in the group (default).voidsetInterpolation(@Nullable String interpolation) Sets the interpolation parameter.voidSet to true if legend should be shown.voidSet the chart time axis scale.The time axis can be either entirely in the past ending at the present time, entirely in the future starting at the present time, or partly in the past and partly in the future around the present time.voidsetRefresh(@Nullable Integer refresh) Set the chart refresh interval in s.voidsetService(String service) Set the persistence service.voidsetYAxisDecimalPattern(@Nullable String yAxisDecimalPattern) Set the format for values on the y axis.Methods inherited from interface org.openhab.core.sitemap.Widget
getIcon, getIconColor, getIconRules, getItem, getLabel, getLabelColor, getParent, getValueColor, getVisibility, getWidgetType, isStaticIcon, setIcon, setIconColor, setIconRules, setItem, setLabel, setLabelColor, setParent, setStaticIcon, setValueColor, setVisibility
-
Method Details
-
getService
@Nullable String getService()Get the configured persistence service, if no service is configured, the default service should be used.- Returns:
- service
-
setService
Set the persistence service.- Parameters:
service-
-
getRefresh
int getRefresh()Get the chart refresh interval in s. If no interval is set, 0 should be returned.- Returns:
- refresh
-
setRefresh
Set the chart refresh interval in s.- Parameters:
refresh-
-
getPeriod
String getPeriod()Get the configured chart time period. SeesetPeriod(String).- Returns:
- period
-
setPeriod
Set the chart time axis scale.The time axis can be either entirely in the past ending at the present time, entirely in the future starting at the present time, or partly in the past and partly in the future around the present time. To do this, the value can be composed of two parts separated by the "-" character, the value before the "-" is then the scale in the past and the value after the "-" is the scale in the future. Valid values before and after the central character "-" are h, 2h, 3h, ..., D, 2D, 3D, ..., W, 2W, 3W, ..., M, 2M, 3M, ..., Y, 2Y, ... and any valid duration following the ISO8601 duration notation such as P1Y6M for the last year and a half or PT1H30M for the last hour and a half. If only a period is provided, i.e. without the final "-" character or without anything after the "-" character, only a period in the past is taken into account.- Parameters:
period-
-
hasLegend
@Nullable Boolean hasLegend()Return true if legend should be shown, false if it should not be shown, null if not explicitly set and it should be determined based on number of series in chart.- Returns:
- legend
-
setLegend
Set to true if legend should be shown. If not set, the legend will not be shown if there is only a single series in the chart.- Parameters:
legend-
-
forceAsItem
boolean forceAsItem()Return true if the group item will be shown instead of items in the group.- Returns:
- forceAsItem
-
setForceAsItem
Set to true if group item should be shown in the chart instead of items in the group (default).- Parameters:
forceAsItem-
-
getYAxisDecimalPattern
@Nullable String getYAxisDecimalPattern()Get the y axis value format pattern.- Returns:
- yAxisDecimalPattern
-
setYAxisDecimalPattern
Set the format for values on the y axis. It acceptsDecimalFormat. For example with #.## a number has 2 decimals.- Parameters:
yAxisDecimalPattern-
-
getInterpolation
@Nullable String getInterpolation()Gets the interpolation parameter. SeesetInterpolation(String).- Returns:
- interpolation
-
setInterpolation
Sets the interpolation parameter. The interpolation parameter is used to change how the line is drawn between 2 datapoints. By default, a horizontal line (step) will be drawn between 2 datapoints of Switch or Contact items. All other item types will have a line (linear) connecting the datapoints. With the "linear" or "step" value for this parameter, this default behaviour can be changed.- Parameters:
interpolation-
-