2018-08-31 20:13:20 +00:00
|
|
|
`Chart` (component)
|
|
|
|
===================
|
|
|
|
|
|
|
|
A chart container using d3, to display timeseries data with an interactive legend.
|
|
|
|
|
|
|
|
Props
|
|
|
|
-----
|
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
### `allowedIntervals`
|
|
|
|
|
|
|
|
- Type: Array
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
Allowed intervals to show in a dropdown.
|
|
|
|
|
2019-02-14 17:24:02 +00:00
|
|
|
### `baseValue`
|
|
|
|
|
|
|
|
- Type: Number
|
|
|
|
- Default: `0`
|
|
|
|
|
|
|
|
Base chart value. If no data value is different than the baseValue, the
|
|
|
|
`emptyMessage` will be displayed if provided.
|
|
|
|
|
2019-02-20 20:18:27 +00:00
|
|
|
### `chartType`
|
|
|
|
|
|
|
|
- Type: One of: 'bar', 'line'
|
|
|
|
- Default: `'line'`
|
|
|
|
|
|
|
|
Chart type of either `line` or `bar`.
|
|
|
|
|
2018-08-31 20:13:20 +00:00
|
|
|
### `data`
|
|
|
|
|
|
|
|
- Type: Array
|
|
|
|
- Default: `[]`
|
|
|
|
|
|
|
|
An array of data.
|
|
|
|
|
2018-09-18 21:37:57 +00:00
|
|
|
### `dateParser`
|
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: `'%Y-%m-%dT%H:%M:%S'`
|
|
|
|
|
|
|
|
Format to parse dates into d3 time format
|
|
|
|
|
2019-02-14 17:24:02 +00:00
|
|
|
### `emptyMessage`
|
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
The message to be displayed if there is no data to render. If no message is provided,
|
|
|
|
nothing will be displayed.
|
|
|
|
|
2018-12-22 11:46:10 +00:00
|
|
|
### `itemsLabel`
|
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
Label describing the legend items.
|
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
### `mode`
|
|
|
|
|
|
|
|
- Type: One of: 'item-comparison', 'time-comparison'
|
|
|
|
- Default: `'time-comparison'`
|
|
|
|
|
|
|
|
`item-comparison` (default) or `time-comparison`, this is used to generate correct
|
|
|
|
ARIA properties.
|
|
|
|
|
2018-11-04 21:25:00 +00:00
|
|
|
### `path`
|
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
Current path
|
|
|
|
|
|
|
|
### `query`
|
|
|
|
|
|
|
|
- Type: Object
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
The query string represented in object form
|
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
### `interactiveLegend`
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
- Type: Boolean
|
|
|
|
- Default: `true`
|
2018-09-21 15:19:05 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
Whether the legend items can be activated/deactivated.
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
### `interval`
|
2018-11-12 14:34:51 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
- Type: One of: 'hour', 'day', 'week', 'month', 'quarter', 'year'
|
|
|
|
- Default: `'day'`
|
2018-11-12 14:34:51 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
Interval specification (hourly, daily, weekly etc).
|
2018-11-12 14:34:51 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
### `intervalData`
|
2018-09-21 15:19:05 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
- Type: Object
|
2018-09-21 15:19:05 +00:00
|
|
|
- Default: null
|
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
Information about the currently selected interval, and set of allowed intervals for the chart. See `getIntervalsForQuery`.
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
### `isRequesting`
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
- Type: Boolean
|
|
|
|
- Default: `false`
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
Render a chart placeholder to signify an in-flight data request.
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
### `legendPosition`
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
- Type: One of: 'bottom', 'side', 'top'
|
|
|
|
- Default: null
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
Position the legend must be displayed in. If it's not defined, it's calculated
|
|
|
|
depending on the viewport width and the mode.
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
### `showHeaderControls`
|
|
|
|
|
|
|
|
- Type: Boolean
|
|
|
|
- Default: `true`
|
|
|
|
|
|
|
|
Wether header UI controls must be displayed.
|
|
|
|
|
|
|
|
### `title`
|
2018-09-18 21:37:57 +00:00
|
|
|
|
|
|
|
- Type: String
|
2019-01-14 09:54:44 +00:00
|
|
|
- Default: null
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
A title describing this chart.
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
### `tooltipLabelFormat`
|
2018-10-10 03:58:34 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
- Type: One of type: string, func
|
|
|
|
- Default: `'%B %d, %Y'`
|
2018-10-10 03:58:34 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
A datetime formatting string or overriding function to format the tooltip label.
|
2018-10-10 03:58:34 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
### `tooltipValueFormat`
|
|
|
|
|
|
|
|
- Type: One of type: string, func
|
|
|
|
- Default: `','`
|
|
|
|
|
|
|
|
A number formatting string or function to format the value displayed in the tooltips.
|
|
|
|
|
|
|
|
### `tooltipTitle`
|
2018-08-31 20:13:20 +00:00
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: null
|
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
A string to use as a title for the tooltip. Takes preference over `tooltipLabelFormat`.
|
2018-08-31 20:13:20 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
### `valueType`
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
- Type: String
|
2018-09-18 21:37:57 +00:00
|
|
|
- Default: null
|
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
What type of data is to be displayed? Number, Average, String?
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
### `xFormat`
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
- Type: String
|
|
|
|
- Default: `'%d'`
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
A datetime formatting string, passed to d3TimeFormat.
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
### `x2Format`
|
2018-11-04 21:25:00 +00:00
|
|
|
|
|
|
|
- Type: String
|
2019-01-14 09:54:44 +00:00
|
|
|
- Default: `'%b %Y'`
|
2018-11-04 21:25:00 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
A datetime formatting string, passed to d3TimeFormat.
|
2018-11-04 21:25:00 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
### `yFormat`
|
2018-08-31 20:13:20 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
- Type: String
|
|
|
|
- Default: `'$.3s'`
|
2018-08-31 20:13:20 +00:00
|
|
|
|
2019-01-14 09:54:44 +00:00
|
|
|
A number formatting string, passed to d3Format.
|
2018-08-31 20:13:20 +00:00
|
|
|
|
2018-11-23 13:54:53 +00:00
|
|
|
`ChartPlaceholder` (component)
|
|
|
|
==============================
|
2018-08-31 20:13:20 +00:00
|
|
|
|
2018-11-23 13:54:53 +00:00
|
|
|
`ChartPlaceholder` displays a large loading indiciator for use in place of a `Chart` while data is loading.
|
2018-08-31 20:13:20 +00:00
|
|
|
|
|
|
|
Props
|
|
|
|
-----
|
|
|
|
|
2018-11-23 13:54:53 +00:00
|
|
|
### `height`
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2018-11-23 13:54:53 +00:00
|
|
|
- Type: Number
|
|
|
|
- Default: `0`
|
2018-09-18 21:37:57 +00:00
|
|
|
|
|
|
|
|