new DateRangeSelector(config)
Creates a new annual daily heatmap chart.
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
config |
object | A configuration object. |
||||||
Properties of
|
||||||||
| Name | Type | Description |
|---|---|---|
svgId |
SVGElement | string | The SVG element to use, or the DOM identifier of an SVG element. |
Throws:
-
Throws an error if provided with an invalid
svgIdelement or id. - Type
- Error
Members
-
:number
id
-
A unique identifier for this sun-path.
Type
- number
-
:SVGElement
svgElem
-
The SVG element to render the chart to.
Type
- SVGElement
Methods
-
comfortBandWidth( [w])
-
Get/set the comfort band width used to show background comfort band.
Parameters:
Name Type Argument Description wnumber <optional>
When provided, this is the width of the comfort band, in degrees Celsius.
Returns:
Returns the current comfort band width.
- Type
- number
-
comfortTemperature( [t])
-
Get/set the comfort temperature used to show background comfort band.
Parameters:
Name Type Argument Description tnumber <optional>
When provided, this sets the center of the comfort band, in degrees Celsius.
Returns:
Returns the current comfort temperature.
- Type
- number
-
detailMode( [mode])
-
Get/set interactive fine detail mode.
Parameters:
Name Type Argument Description modeboolean <optional>
When provided, this sets the detailed mode on or off.
Returns:
Returns the current detail mode state.
- Type
- boolean
-
height( [height])
-
Get/set the overall height of the chart, in pixels.
Parameters:
Name Type Argument Description heightnumber <optional>
When provided, this sets the new chart height in pixels.
Returns:
Returns the current chart height in pixels.
- Type
- number
-
paddingBottom( [pixels])
-
Get/set the inset on the bottom side of the chart.
Parameters:
Name Type Argument Description pixelsnumber <optional>
When provided, this sets the number of pixels the chart axis is indented from the parent container edge on the bottom side.
Returns:
Returns the current bottom padding in pixels.
- Type
- number
-
paddingLeft( [pixels])
-
Get/set the inset on the left side of the chart.
Parameters:
Name Type Argument Description pixelsnumber <optional>
When provided, this sets the number of pixels the chart axis is indented from the parent container edge on the left side.
Returns:
Returns the current left padding in pixels.
- Type
- number
-
paddingRight( [pixels])
-
Get/set the inset on the right side of the chart.
Parameters:
Name Type Argument Description pixelsnumber <optional>
When provided, this sets the number of pixels the chart axis is indented from the parent container edge on the right side.
Returns:
Returns the current right padding in pixels.
- Type
- number
-
paddingTop( [pixels])
-
Get/set the inset on the top side of the chart.
Parameters:
Name Type Argument Description pixelsnumber <optional>
When provided, this sets the number of pixels the chart axis is indented from the parent container edge on the top side.
Returns:
Returns the current top padding in pixels.
- Type
- number
-
refresh()
-
Regenerates the chart from scratch.
Returns:
Returns this chart instance to support method chaining.
- Type
- object
-
rescale( [instant])
-
Initiates a rescaling of the chart when it has changed size or shape. The maximum frequency at which this method will actually rescale the chart is governed by the 'throttledRescale' property.
Parameters:
Name Type Argument Default Description instantboolean <optional>
<nullable>
false An optional flag to make the rescale immediate even if debounced, defaults to false.
Returns:
Returns this chart instance to support method chaining.
- Type
- object
-
set(config)
-
Sets one or more configuration values for the chart.
Parameters:
Name Type Description configobject An object containing one or more configuration settings.
Returns:
Returns this object instance to support method chaining.
- Type
- object
-
setAnnualWeatherData(metric)
-
Sets the data to the given annual weather data array.
Parameters:
Name Type Description metricobject The data object obtained from
pdWeather.Data.getMetricmethod.Returns:
Returns this object instance to support method chaining.
- Type
- object
-
setData(array)
-
Sets the data to the given array.
Parameters:
Name Type Description arrayArray The data array to display.
Returns:
Returns this object instance to support method chaining.
- Type
- object
-
setDataColors(range_fill, range_stroke, avg_stroke, fill_opacity)
-
Set the colors to use for data display.
Parameters:
Name Type Description range_fillstring The CSS color of the fill for data range.
range_strokestring The CSS color of the stroke for data range.
avg_strokestring The CSS color of the average data line.
fill_opacitynumber The opacity of the data range fill color.
Returns:
Returns this object instance to support method chaining.
- Type
- object
-
setRange(start, end)
-
Sets the minimum and maximum values in the X axis.
Parameters:
Name Type Description startnumber The starting day of the year.
endnumber The ending day of the year.
Returns:
Returns this chart instance to support method chaining.
- Type
- object
-
setWeatherData(metric)
-
Sets the data to the given weather data metric object.
Parameters:
Name Type Description metricobject The data object obtained from
pdWeather.Data.getMetricmethod.Returns:
Returns this object instance to support method chaining.
- Type
- object
-
show(state)
-
Shows or hides the chart based on given state.
Parameters:
Name Type Description stateboolean Use true to show, false to hide.
Returns:
Returns this chart instance to support method chaining.
- Type
- object
-
showComfortBand( [show])
-
Get/set whether or not to show comfort temperature band in background.
Parameters:
Name Type Argument Description showboolean <optional>
When provided, this sets the new state of the comfort band.
Returns:
Returns the current comfort band state.
- Type
- boolean
-
throttledRescale( [ms])
-
Get/set the timer value for throttling calls to the
rescale()method.This basically means that multiple calls to the
rescale()method that occur within the specified number of milliseconds will be amalgamated to a single call that occurs at the end of that period.Parameters:
Name Type Argument Description msnumber <optional>
When provided, this sets the throttling time, in milliseconds. Any value less than 5ms effectively turns off throttling.
Returns:
Returns the current throttling time in milliseconds.
- Type
- number
-
width( [width])
-
Get/set the overall width of the chart.
Parameters:
Name Type Argument Description widthnumber <optional>
When provided, this sets the new chart width in pixels.
Returns:
Returns the current chart width in pixels.
- Type
- number