Skip to content

Commit 6d2817b

Browse files
authored
X axis sorting (#499)
1 parent fdee353 commit 6d2817b

File tree

2 files changed

+22
-31
lines changed

2 files changed

+22
-31
lines changed

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

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

ckanext/querytool/templates/ajax_snippets/chart_item.html

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@
282282
</div>
283283
</div>
284284

285-
286285
{# X-axis label orientation #}
287286
{% set text_rotation = h.querytool_get_tick_text_rotation() %}
288287
{% if selected_chart_type in ['pie', 'donut'] %}
@@ -301,6 +300,8 @@
301300
</div>
302301
</div>
303302

303+
304+
304305
{# X-axis label multiline #}
305306
{% if chart %}
306307
{% set x_text_multiline = chart.x_text_multiline %}
@@ -370,6 +371,7 @@
370371
<div id="accordion_{{ chart_id }}_y_axis" class="accordion-body collapse">
371372
<div class="accordion-inner">
372373

374+
373375
{# Y-axis title #}
374376
{% if chart %}
375377
{% set y_label = chart.y_label %}
@@ -454,6 +456,18 @@
454456
<div id="accordion_{{ chart_id }}_graph" class="accordion-body collapse">
455457
<div class="accordion-inner">
456458

459+
{# X sorting #}
460+
{% set sort_options = h.querytool_get_chart_sort() %}
461+
<div id="chart_field_sort_div_{{ n }}" class="control-group control-select {% if chart and chart.category_name %}hidden{% endif %}">
462+
<label class="control-label" for="chart_field_sort_{{ n }}">{{ _('Data sorting') }}</label>
463+
<div class="controls ">
464+
<select id="chart_field_sort_{{ n }}" name="chart_field_sort_{{ n }}" >
465+
{% for sort in sort_options %}
466+
<option value="{{ sort.value }}" {% if chart %}{{ 'selected' if sort.value == chart.sort }}{% endif %} >{{ sort.text }}</option>
467+
{% endfor %}
468+
</select>
469+
</div>
470+
</div>
457471

458472
{# Data format #}
459473
{% set data_formats = h.queytool_get_charts_data_formats() %}
@@ -473,19 +487,6 @@
473487
</div>
474488
</div>
475489

476-
{# X sorting #}
477-
{% set sort_options = h.querytool_get_chart_sort() %}
478-
<div id="chart_field_sort_div_{{ n }}" class="control-group control-select {% if chart and chart.category_name %}hidden{% endif %}">
479-
<label class="control-label" for="chart_field_sort_{{ n }}">{{ _('Data sorting') }}</label>
480-
<div class="controls ">
481-
<select id="chart_field_sort_{{ n }}" name="chart_field_sort_{{ n }}" >
482-
{% for sort in sort_options %}
483-
<option value="{{ sort.value }}" {% if chart %}{{ 'selected' if sort.value == chart.sort }}{% endif %} >{{ sort.text }}</option>
484-
{% endfor %}
485-
</select>
486-
</div>
487-
</div>
488-
489490
{# Donut chart hole #}
490491
{% if chart %}
491492
{% set donut_hole = chart.donut_hole or 0.4 %}
@@ -629,18 +630,6 @@
629630
</div>
630631
{# {% endif %} #}
631632

632-
{# X sorting #}
633-
{% set sort_options = h.querytool_get_chart_sort() %}
634-
<div id="chart_field_sort_div_{{ n }}" class="control-group control-select {% if chart and chart.category_name %}hidden{% endif %}">
635-
<label class="control-label" for="chart_field_sort_{{ n }}">{{ _('Data sorting') }}</label>
636-
<div class="controls ">
637-
<select id="chart_field_sort_{{ n }}" name="chart_field_sort_{{ n }}" >
638-
{% for sort in sort_options %}
639-
<option value="{{ sort.value }}" {% if chart %}{{ 'selected' if sort.value == chart.sort }}{% endif %} >{{ sort.text }}</option>
640-
{% endfor %}
641-
</select>
642-
</div>
643-
</div>
644633

645634
</div>
646635
</div>

0 commit comments

Comments
 (0)