Class: OpenHAB::DSL::Sitemaps::ChartBuilder

Inherits:
WidgetBuilder show all
Defined in:
lib/openhab/dsl/sitemaps/builder.rb

Overview

See Also:

  • orgorg.openhaborg.openhab.coreorg.openhab.core.modelorg.openhab.core.model.sitemaporg.openhab.core.model.sitemap.sitemaporg.openhab.core.model.sitemap.sitemap.Chart

Constant Summary collapse

VALID_PERIODS =

Valid #period values

%i[h 4h 8h 12h D 2D 3D W 2W M 2M 4M Y].freeze

Instance Attribute Summary collapse

Attributes inherited from WidgetBuilder

#icon, #icon_colors, #item, #label, #label_colors, #static_icon, #value_colors, #visibilities

Instance Method Summary collapse

Methods inherited from WidgetBuilder

#icon_color, #label_color, #value_color, #visibility

Methods included from Core::EntityLookup

#method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class OpenHAB::Core::EntityLookup

Instance Attribute Details

#group=(value) ⇒ true, ... (writeonly)

Show the value of a GroupItem instead of showing a graph for each member (which is the default).

Returns:

  • (true, false, nil)


490
491
492
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 490

def group=(value)
  @group = value
end

#legend=(value) ⇒ true, ... (writeonly)

Always show the legend, never show the legend, or automatically show the legend if there is more than one series in the chart.

Returns:

  • (true, false, nil)


486
487
488
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 486

def legend=(value)
  @legend = value
end

#period:h, ...

Time axis scale

Returns:

  • (:h, :"4h", :"8h", :"12h", :D, :"2D", :"3D", :W, :"2W", :M, :"2M", :"4M", :Y, nil)


482
483
484
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 482

def period
  @period
end

#refreshNumeric?

How often to refresh the chart (in seconds)

Returns:



479
480
481
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 479

def refresh
  @refresh
end

#serviceString?

The persistence service to use

Returns:

  • (String, nil)


476
477
478
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 476

def service
  @service
end

#y_axis_patternString?

Formatting string for values on the y axis.

Examples:

"#.##" # => formats a number with two decimals.

Returns:

  • (String, nil)

See Also:



496
497
498
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 496

def y_axis_pattern
  @y_axis_pattern
end

Instance Method Details

#group?true, ...

Show the value of a GroupItem instead of showing a graph for each member (which is the default).

Returns:

  • (true, false, nil)


546
547
548
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 546

def group?
  @group
end

#legend?true, ...

Always show the legend, never show the legend, or automatically show the legend if there is more than one series in the chart.

Returns:

  • (true, false, nil)


541
542
543
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 541

def legend?
  @legend
end