Skip to content

Commit b853ea1

Browse files
authored
Fix/scatter category intervals (#464)
1 parent bd3f854 commit b853ea1

File tree

2 files changed

+73
-37
lines changed

2 files changed

+73
-37
lines changed

ckanext/querytool/fanstatic/javascript/dist/modules/viz-preview.js

Lines changed: 69 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ckanext/querytool/logic/action/get.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ def querytool_get_chart_data(context, data_dict):
211211
sql_without_group = sql_string.split('GROUP BY')[0]
212212
sql_group = sql_string.split('GROUP BY')[1]
213213
categories_data = {}
214+
#log.error(data_dict)
214215

215216
if chart_filter:
216217
previous_filters.append(chart_filter)
@@ -242,16 +243,17 @@ def querytool_get_chart_data(context, data_dict):
242243
x.append(value)
243244

244245
for record in records:
246+
#log.error(record)
245247
if upper_bounds and lower_bounds and \
246248
record.get(upper_bounds.lower()) and \
247249
record.get(upper_bounds.lower()):
248-
upper_bound_value = record[upper_bounds.lower()]
250+
upper_bound_value = record.get(upper_bounds.lower())
249251

250252
categories_data.setdefault(
251253
upper_bounds.lower(), {}).setdefault(
252254
record[x_axis.lower()], []).append(upper_bound_value)
253255

254-
lower_bound_value = record[lower_bounds.lower()]
256+
lower_bound_value = record.get(lower_bounds.lower())
255257

256258
categories_data.setdefault(
257259
lower_bounds.lower(), {}).setdefault(

0 commit comments

Comments
 (0)