mirror of
https://github.com/apache/superset.git
synced 2026-06-03 06:39:25 +00:00
feat(plugin-chart-echarts): support non-timeseries x-axis (#17917)
* feat(plugin-chart-echarts): support non-timeseries x-axis * fix tests * change formula return type from Date to number * add x_axis test coverage * rename func and improve coverage * add x-axis control to bar chart * remove redundant console.log * fix description * make x-axis control mandatory * 🙃 * fix x-axis formatter * fix showValues * fix implicit rDTTM_ALIAS references in postProcessing * replace TIME_COLUMN with DTTM_ALIAS * fix remaining implicit indexes * fix: Disable filtering on wide result sets (#18021) * fix: handle null values in time-series table (#18039) * cleanup column_type_mappings (#17569) Signed-off-by: Đặng Minh Dũng <dungdm93@live.com> * important change to MakeFile (#18037) * add missing is_timeseries to pivot op Co-authored-by: Erik Ritter <erik.ritter@airbnb.com> Co-authored-by: Grace Guo <grace.guo@airbnb.com> Co-authored-by: Đặng Minh Dũng <dungdm93@live.com> Co-authored-by: AAfghahi <48933336+AAfghahi@users.noreply.github.com>
This commit is contained in:
@@ -306,10 +306,14 @@ class QueryContextProcessor:
|
||||
# 2. rename extra query columns
|
||||
offset_metrics_df = offset_metrics_df.rename(columns=metrics_mapping)
|
||||
|
||||
# 3. set time offset for dttm column
|
||||
offset_metrics_df[DTTM_ALIAS] = offset_metrics_df[
|
||||
DTTM_ALIAS
|
||||
] - DateOffset(**normalize_time_delta(offset))
|
||||
# 3. set time offset for index
|
||||
# TODO: add x-axis to QueryObject, potentially as an array for
|
||||
# multi-dimensional charts
|
||||
granularity = query_object.granularity
|
||||
index = granularity if granularity in df.columns else DTTM_ALIAS
|
||||
offset_metrics_df[index] = offset_metrics_df[index] - DateOffset(
|
||||
**normalize_time_delta(offset)
|
||||
)
|
||||
|
||||
# df left join `offset_metrics_df`
|
||||
offset_df = df_utils.left_join_df(
|
||||
|
||||
Reference in New Issue
Block a user