Skip to content

Commit b7a389a

Browse files
author
Zoran Pandovski
committed
Add y axis label
1 parent 758ad27 commit b7a389a

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

ckanext/querytool/templates/ajax_snippets/chart_fields.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@
113113
</div>
114114
</div>
115115

116+
{% if chart %}
117+
{% set y_label = chart.y_label %}
118+
{% endif %}
119+
<div class="control-group ">
120+
<label class="control-label" for="chart_field_y_label_{{ n }}">{{ _('Y axis label') }}</label>
121+
<div class="controls ">
122+
<input id="chart_field_y_label_{{ n }}" type="text" name="chart_field_y_label_{{ n }}" value="{{ y_label }}">
123+
</div>
124+
</div>
125+
116126

117127
{% if chart %}
118128
{% set ptop = chart.padding_top %}
@@ -159,6 +169,7 @@
159169
{% set padding_bottom = chart.padding_bottom %}
160170
{% set padding_top = chart.padding_top %}
161171
{% set show_labels = chart.show_labels %}
172+
{% set y_label = chart.y_label %}
162173
{% endif %}
163174

164175
{% snippet 'ajax_snippets/visualization_item.html',
@@ -176,7 +187,8 @@
176187
y_tick_format = y_tick_format,
177188
padding_bottom = padding_bottom,
178189
padding_top = padding_top,
179-
show_labels = show_labels
190+
show_labels = show_labels,
191+
y_label = y_label
180192
%}
181193
</div>
182194
</div>

ckanext/querytool/templates/ajax_snippets/visualization_item.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
data-module-y_tick_format="{{ y_tick_format }}"
1414
data-module-padding_top="{{ padding_top }}"
1515
data-module-padding_bottom="{{ padding_bottom }}"
16-
data-module-show_labels="{{ show_labels }}">
16+
data-module-show_labels="{{ show_labels }}"
17+
data-module-y_label="{{ y_label }}">
1718
Loading...
1819
</div>

ckanext/querytool/templates/querytool/public/read.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ <h1>{{ querytool.title }}</h1>`
8383
y_tick_format = item.y_tick_format,
8484
padding_bottom = item.padding_bottom,
8585
padding_top = item.padding_top,
86-
show_labels = item.show_labels
86+
show_labels = item.show_labels,
87+
y_label = item.y_label
8788
%}
8889
</div>
8990
{% endfor %}

0 commit comments

Comments
 (0)