Skip to content

Commit 40d672e

Browse files
feat(GraphComponent): Conditionally disable decimals for yAxis based on authored content (#2220)
1 parent 0e31212 commit 40d672e

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/assets/wise5/components/graph/graph-student/graph-student.component.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,9 @@ export class GraphStudent extends ComponentStudent {
602602
*/
603603
drawGraphHelper(resolve) {
604604
this.turnOffXAxisDecimals();
605-
this.turnOffYAxisDecimals();
605+
if (!this.isAllowDecimalsForYAxis()) {
606+
this.turnOffYAxisDecimals();
607+
}
606608
this.copyXAxisPlotBandsFromComponentContent();
607609
this.setupXAxisLimitSpacerWidth();
608610
let series = null;
@@ -655,6 +657,12 @@ export class GraphStudent extends ComponentStudent {
655657
this.xAxis.allowDecimals = false;
656658
}
657659

660+
private isAllowDecimalsForYAxis(): boolean {
661+
return isSingleYAxis(this.yAxis)
662+
? this.yAxis.allowDecimals
663+
: this.yAxis.some((yAxis) => yAxis.allowDecimals);
664+
}
665+
658666
turnOffYAxisDecimals() {
659667
if (isSingleYAxis(this.yAxis)) {
660668
this.yAxis.allowDecimals = false;

src/messages.xlf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19189,39 +19189,39 @@ Category Name: <x id="PH_1" equiv-text="categoryName"/></source>
1918919189
<source>The series you are trying to add a point to is currently hidden. Please show the series by clicking the series name in the legend and try adding the point again.</source>
1919019190
<context-group purpose="location">
1919119191
<context context-type="sourcefile">src/assets/wise5/components/graph/graph-student/graph-student.component.ts</context>
19192-
<context context-type="linenumber">853</context>
19192+
<context context-type="linenumber">861</context>
1919319193
</context-group>
1919419194
</trans-unit>
1919519195
<trans-unit id="2852989551014711458" datatype="html">
1919619196
<source>You can not edit this series. Please choose a series that can be edited.</source>
1919719197
<context-group purpose="location">
1919819198
<context context-type="sourcefile">src/assets/wise5/components/graph/graph-student/graph-student.component.ts</context>
19199-
<context context-type="linenumber">867</context>
19199+
<context context-type="linenumber">875</context>
1920019200
</context-group>
1920119201
</trans-unit>
1920219202
<trans-unit id="7053114367342967943" datatype="html">
1920319203
<source>Are you sure you want to reset the series?</source>
1920419204
<context-group purpose="location">
1920519205
<context context-type="sourcefile">src/assets/wise5/components/graph/graph-student/graph-student.component.ts</context>
19206-
<context context-type="linenumber">1100</context>
19206+
<context context-type="linenumber">1108</context>
1920719207
</context-group>
1920819208
</trans-unit>
1920919209
<trans-unit id="7889560203726829643" datatype="html">
1921019210
<source>Are you sure you want to reset the &quot;<x id="PH" equiv-text="seriesName"/>&quot; series?</source>
1921119211
<context-group purpose="location">
1921219212
<context context-type="sourcefile">src/assets/wise5/components/graph/graph-student/graph-student.component.ts</context>
19213-
<context context-type="linenumber">1102</context>
19213+
<context context-type="linenumber">1110</context>
1921419214
</context-group>
1921519215
</trans-unit>
1921619216
<trans-unit id="6999515396807067782" datatype="html">
1921719217
<source>Trial</source>
1921819218
<context-group purpose="location">
1921919219
<context context-type="sourcefile">src/assets/wise5/components/graph/graph-student/graph-student.component.ts</context>
19220-
<context context-type="linenumber">1519</context>
19220+
<context context-type="linenumber">1527</context>
1922119221
</context-group>
1922219222
<context-group purpose="location">
1922319223
<context context-type="sourcefile">src/assets/wise5/components/graph/graph-student/graph-student.component.ts</context>
19224-
<context context-type="linenumber">2351</context>
19224+
<context context-type="linenumber">2359</context>
1922519225
</context-group>
1922619226
</trans-unit>
1922719227
<trans-unit id="7500488806315952979" datatype="html">

0 commit comments

Comments
 (0)