ChartDataQueryContextSchema
Override the default cache timeout
datasource object
id objectrequired
Datasource id/uuid
- integer
- string
Datasource type
Possible values: [table, dataset, query, saved_query, view]
Should the queries be forced to load from the source. Default: false
queries object[]
annotation_layers object[]nullable
Annotation layers to apply to chart
Type of annotation layer
Possible values: [FORMULA, INTERVAL, EVENT, TIME_SERIES]
Layer color
Columns to use as the description. If none are provided, all will be shown.
Should line be hidden. Only applies to line annotations
Column containing end of interval. Only applies to interval layers
Name of layer
Opacity of layer
Possible values: [``, opacityLow, opacityMedium, opacityHigh]
overrides objectnullable
which properties should be overridable
Should the layer be shown
Should the label always be shown
Should markers be shown. Only applies to line annotations.
Type of source for annotation data
Possible values: [``, line, NATIVE, table]
Line style. Only applies to time-series annotations
Possible values: [dashed, dotted, solid, longDashed]
Column with event date or interval start date
Column with title
For formula annotations, this contains the formula. For other types, this is the primary key of the source object.
Width of annotation line
Possible values: >= 0
A mapping of temporal extras that have been applied to the query
{"__time_range":"1 year ago : now"}Add fetch values predicate (where clause) to query if defined in datasource
Columns which to select in the query.
datasource objectnullable
id objectrequired
Datasource id/uuid
- integer
- string
Datasource type
Possible values: [table, dataset, query, saved_query, view]
extras objectnullable
Extra parameters to add to the query.
HAVING clause to be added to aggregate queries using AND operator.
This is only set using the new time comparison controls that is made available in some plugins behind the experimental feature flag.
End time for relative time deltas. Default: config["DEFAULT_RELATIVE_START_TIME"]
Possible values: [today, now]
Start time for relative time deltas. Default: config["DEFAULT_RELATIVE_START_TIME"]
Possible values: [today, now]
To what level of granularity should the temporal column be aggregated. Supports ISO 8601 durations.
Possible values: [PT1S, PT5S, PT30S, PT1M, PT5M, PT10M, PT15M, PT30M, PT1H, PT6H, P1D, P1W, P1M, P3M, P1Y, 1969-12-28T00:00:00Z/P1W, 1969-12-29T00:00:00Z/P1W, P1W/1970-01-03T00:00:00Z, P1W/1970-01-04T00:00:00Z]
P1DWHERE clause to be added to queries using AND operator.
filters object[]nullable
The column to filter by. Can be either a string (physical or saved expression) or an object (adhoc column)
countryOptional time grain for temporal filters
PT1MIndicates if the filter has been added by a filter component as opposed to being a part of the original query.
The comparison operator.
Possible values: [==, !=, >, <, >=, <=, LIKE, NOT LIKE, ILIKE, IS NULL, IS NOT NULL, IN, NOT IN, IS TRUE, IS FALSE, TEMPORAL_RANGE]
INThe value or values to compare against. Can be a string, integer, decimal, None or list, depending on the operator.
["China","France","Japan"]Name of temporal column used for time filtering.
Name of temporal column used for time filtering for SQL datasources. This field is deprecated, use granularity instead.
Columns by which to group the query. This field is deprecated, use columns instead.
HAVING clause to be added to aggregate queries using AND operator. This field is deprecated and should be passed to extras.
Should the rowcount of the actual query be returned
Is the query_object a timeseries.
Aggregate expressions. Metrics can be passed as both references to datasource metrics (strings), or ad-hoc metricswhich are defined only within the query object. See ChartDataAdhocMetricSchema for the structure of ad-hoc metrics.
Reverse order. Default: false
Expects a list of lists where the first element is the column name which to sort by, and the second element is a boolean.
[["my_col_1",false],["my_col_2",true]]post_processing object[]nullable
Post processing operations to be applied to the result set. Operations are applied to the result set in sequential order.
Post processing operation type
Possible values: [aggregate, boxplot, compare, contribution, cum, diff, escape_separator, flatten, geodetic_parse, geohash_decode, geohash_encode, histogram, pivot, prophet, rank, rename, resample, rolling, select, sort, unescape_separator]
aggregateOptions specifying how to perform the operation. Please refer to the respective post processing operation option schemas. For example, ChartDataPostProcessingOperationOptions specifies the required options for the pivot operation.
{"aggregates":{"age_mean":{"column":"age","operator":"mean"},"age_q1":{"column":"age","operator":"percentile","options":{"q":0.25}}},"groupby":["country","gender"]}Possible values: [columns, full, query, results, samples, timegrains, post_processed, drill_detail]
Maximum row count (0=disabled). Default: config["ROW_LIMIT"]
Possible values: >= 0
Number of rows to skip. Default: 0
Possible values: >= 0
Columns to use when limiting series count. All columns must be present in the columns property. Requires series_limit and series_limit_metric to be set.
Maximum number of series. Requires series and series_limit_metric to be set.
Metric used to limit timeseries queries by. Requires series and series_limit to be set.
A time rage, either expressed as a colon separated string since : until or human readable freeform. Valid formats for since and until are:
- ISO 8601
- X days/years/hours/day/year/weeks
- X days/years/hours/day/year/weeks ago
- X days/years/hours/day/year/weeks from now
Additionally, the following freeform can be used:
- Last day
- Last week
- Last month
- Last quarter
- Last year
- No filter
- Last X seconds/minutes/hours/days/weeks/months/years
- Next X seconds/minutes/hours/days/weeks/months/years
Last weekA human-readable date/time string. Please refer to parsdatetime documentation for details on valid values.
Maximum row count for timeseries queries. This field is deprecated, use series_limit instead.Default: 0
Metric used to limit timeseries queries by. This field is deprecated, use series_limit_metric instead.
url_params objectnullable
Optional query parameters passed to a dashboard or Explore view
The value of the query parameter
WHERE clause to be added to queries using AND operator.This field is deprecated and should be passed to extras.
Possible values: [csv, json, xlsx]
Possible values: [columns, full, query, results, samples, timegrains, post_processed, drill_detail]
{
"custom_cache_timeout": 0,
"datasource": {
"id": 0,
"type": "table"
},
"force": true,
"queries": [
{
"annotation_layers": [
{
"annotationType": "FORMULA",
"color": "string",
"descriptionColumns": [
"string"
],
"hideLine": true,
"intervalEndColumn": "string",
"name": "string",
"opacity": "",
"overrides": {},
"show": true,
"showLabel": true,
"showMarkers": true,
"sourceType": "",
"style": "dashed",
"timeColumn": "string",
"titleColumn": "string",
"width": 0
}
],
"applied_time_extras": {
"__time_range": "1 year ago : now"
},
"apply_fetch_values_predicate": true,
"columns": [
null
],
"datasource": {
"id": 0,
"type": "table"
},
"extras": {
"having": "string",
"instant_time_comparison_range": "string",
"relative_end": "today",
"relative_start": "today",
"time_grain_sqla": "P1D",
"where": "string"
},
"filters": [
{
"col": "country",
"grain": "PT1M",
"isExtra": true,
"op": "IN",
"val": [
"China",
"France",
"Japan"
]
}
],
"granularity": "string",
"groupby": [
null
],
"is_rowcount": true,
"is_timeseries": true,
"metrics": [
null
],
"order_desc": true,
"orderby": [
[
"my_col_1",
false
],
[
"my_col_2",
true
]
],
"post_processing": [
{
"operation": "aggregate",
"options": {
"aggregates": {
"age_mean": {
"column": "age",
"operator": "mean"
},
"age_q1": {
"column": "age",
"operator": "percentile",
"options": {
"q": 0.25
}
}
},
"groupby": [
"country",
"gender"
]
}
}
],
"row_limit": 0,
"row_offset": 0,
"series_columns": [
null
],
"series_limit": 0,
"time_offsets": [
"string"
],
"time_range": "Last week",
"time_shift": "string",
"timeseries_limit": 0,
"url_params": {}
}
]
}