Skip to content

Commit fc6d70b

Browse files
author
minjk-bl
committed
Apps > Chart - fix x, y limit option
1 parent c6e4021 commit fc6d70b

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

css/root.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,10 @@ body {
253253
.vp-cursor {
254254
cursor: pointer;
255255
}
256+
/* hidden */
257+
.vp-hidden {
258+
display: none;
259+
}
256260
/* No-selection */
257261
.vp-no-selection {
258262
-webkit-touch-callout: none; /* iOS Safari */

html/m_apps/chart.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,19 @@
263263
</tr>
264264
<tr>
265265
<th>X Limit</th>
266-
<td><input type="text" class="vp-input vp-state" id="xlimit" placeholder="(min, max)" /></td>
266+
<td>
267+
<input type="number" class="vp-input vp-state" id="xlimit_min" placeholder="Minimum limit" />
268+
<input type="number" class="vp-input vp-state" id="xlimit_max" placeholder="Maximum limit" />
269+
<input type="text" class="vp-hidden vp-state" id="xlim"/>
270+
</td>
267271
</tr>
268272
<tr>
269273
<th>Y Limit</th>
270-
<td><input type="text" class="vp-input vp-state" id="ylimit" placeholder="(min, max)" /></td>
274+
<td>
275+
<input type="number" class="vp-input vp-state" id="ylimit_min" placeholder="Minimum limit" />
276+
<input type="number" class="vp-input vp-state" id="ylimit_max" placeholder="Maximum limit" />
277+
<input type="text" class="vp-hidden vp-state" id="ylim"/>
278+
</td>
271279
</tr>
272280
<tr>
273281
<th></th>

js/m_apps/Chart.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,28 @@ define([
133133
});
134134
fileNavi.open();
135135
});
136+
137+
// xlimit
138+
$(this.wrapSelector('#xlimit_min')).change(function() {
139+
let xlim_min = $(that.wrapSelector('#xlimit_min')).val();
140+
let xlim_max = $(that.wrapSelector('#xlimit_max')).val();
141+
$(that.wrapSelector('#xlim')).val(com_util.formatString('({0}, {1})', xlim_min, xlim_max));
142+
});
143+
$(this.wrapSelector('#xlimit_max')).change(function() {
144+
let xlim_min = $(that.wrapSelector('#xlimit_min')).val();
145+
let xlim_max = $(that.wrapSelector('#xlimit_max')).val();
146+
$(that.wrapSelector('#xlim')).val(com_util.formatString('({0}, {1})', xlim_min, xlim_max));
147+
});
148+
$(this.wrapSelector('#ylimit_min')).change(function() {
149+
let ylim_min = $(that.wrapSelector('#ylimit_min')).val();
150+
let ylim_max = $(that.wrapSelector('#ylimit_max')).val();
151+
$(that.wrapSelector('#ylim')).val(com_util.formatString('({0}, {1})', ylim_min, ylim_max));
152+
});
153+
$(this.wrapSelector('#ylimit_max')).change(function() {
154+
let ylim_min = $(that.wrapSelector('#ylimit_min')).val();
155+
let ylim_max = $(that.wrapSelector('#ylimit_max')).val();
156+
$(that.wrapSelector('#ylim')).val(com_util.formatString('({0}, {1})', ylim_min, ylim_max));
157+
});
136158
}
137159

138160
templateForBody() {

0 commit comments

Comments
 (0)