2018-08-31 20:13:20 +00:00
|
|
|
`Chart` (component)
|
|
|
|
===================
|
|
|
|
|
|
|
|
A chart container using d3, to display timeseries data with an interactive legend.
|
|
|
|
|
|
|
|
Props
|
|
|
|
-----
|
|
|
|
|
|
|
|
### `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
|
|
|
|
|
2018-12-22 11:46:10 +00:00
|
|
|
### `itemsLabel`
|
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
Label describing the legend items.
|
|
|
|
|
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
|
|
|
|
|
2018-11-12 14:34:51 +00:00
|
|
|
### `tooltipLabelFormat`
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2018-11-23 13:54:53 +00:00
|
|
|
- Type: One of type: string, func
|
2018-09-21 15:19:05 +00:00
|
|
|
- Default: `'%B %d, %Y'`
|
|
|
|
|
2018-11-23 13:54:53 +00:00
|
|
|
A datetime formatting string or overriding function to format the tooltip label.
|
2018-09-18 21:37:57 +00:00
|
|
|
|
2018-11-12 14:34:51 +00:00
|
|
|
### `tooltipValueFormat`
|
|
|
|
|
2018-11-23 13:54:53 +00:00
|
|
|
- Type: One of type: string, func
|
2018-11-12 14:34:51 +00:00
|
|
|
- Default: `','`
|
|
|
|
|
|
|
|
A number formatting string or function to format the value displayed in the tooltips.
|
|
|
|
|
2018-09-21 15:19:05 +00:00
|
|
|
### `tooltipTitle`
|
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: null
|
|
|
|
|
2018-11-12 14:34:51 +00:00
|
|
|
A string to use as a title for the tooltip. Takes preference over `tooltipLabelFormat`.
|
2018-09-18 21:37:57 +00:00
|
|
|
|
|
|
|
### `xFormat`
|
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: `'%d'`
|
|
|
|
|
|
|
|
A datetime formatting string, passed to d3TimeFormat.
|
|
|
|
|
|
|
|
### `x2Format`
|
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: `'%b %Y'`
|
|
|
|
|
|
|
|
A datetime formatting string, passed to d3TimeFormat.
|
|
|
|
|
|
|
|
### `yFormat`
|
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: `'$.3s'`
|
|
|
|
|
|
|
|
A number formatting string, passed to d3Format.
|
|
|
|
|
2018-10-10 03:58:34 +00:00
|
|
|
### `mode`
|
|
|
|
|
|
|
|
- Type: One of: 'item-comparison', 'time-comparison'
|
2018-11-23 13:54:53 +00:00
|
|
|
- Default: `'time-comparison'`
|
2018-10-10 03:58:34 +00:00
|
|
|
|
|
|
|
`item-comparison` (default) or `time-comparison`, this is used to generate correct
|
|
|
|
ARIA properties.
|
|
|
|
|
2018-08-31 20:13:20 +00:00
|
|
|
### `title`
|
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
A title describing this chart.
|
|
|
|
|
2018-09-18 21:37:57 +00:00
|
|
|
### `type`
|
|
|
|
|
|
|
|
- Type: One of: 'bar', 'line'
|
|
|
|
- Default: `'line'`
|
|
|
|
|
|
|
|
Chart type of either `line` or `bar`.
|
|
|
|
|
|
|
|
### `intervalData`
|
|
|
|
|
|
|
|
- Type: Object
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
Information about the currently selected interval, and set of allowed intervals for the chart. See `getIntervalsForQuery`.
|
|
|
|
|
|
|
|
### `interval`
|
|
|
|
|
|
|
|
- Type: One of: 'hour', 'day', 'week', 'month', 'quarter', 'year'
|
|
|
|
- Default: `'day'`
|
|
|
|
|
|
|
|
Interval specification (hourly, daily, weekly etc).
|
|
|
|
|
|
|
|
### `allowedIntervals`
|
|
|
|
|
|
|
|
- Type: Array
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
Allowed intervals to show in a dropdown.
|
|
|
|
|
2018-11-04 21:25:00 +00:00
|
|
|
### `valueType`
|
|
|
|
|
|
|
|
- Type: String
|
|
|
|
- Default: null
|
|
|
|
|
|
|
|
What type of data is to be displayed? Number, Average, String?
|
|
|
|
|
2018-11-23 13:54:53 +00:00
|
|
|
### `isRequesting`
|
2018-08-31 20:13:20 +00:00
|
|
|
|
2018-11-23 13:54:53 +00:00
|
|
|
- Type: Boolean
|
|
|
|
- Default: `false`
|
2018-08-31 20:13:20 +00:00
|
|
|
|
2018-11-23 13:54:53 +00:00
|
|
|
Render a chart placeholder to signify an in-flight data request.
|
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
|
|
|
|
|
|
|
|