|
@@ -302,6 +302,7 @@ public class ClasspathOutlookExamSprintReportRenderer implements ExamSprintRepor
|
|
|
.append("<div class='chart-box'>")
|
|
.append("<div class='chart-box'>")
|
|
|
.append("<svg class='past-paper-column-chart'").append(SVG_CJK_FONT_FAMILY)
|
|
.append("<svg class='past-paper-column-chart'").append(SVG_CJK_FONT_FAMILY)
|
|
|
.append(" xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 220' role='img' aria-label='真题试卷词汇掌握情况'>")
|
|
.append(" xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 220' role='img' aria-label='真题试卷词汇掌握情况'>")
|
|
|
|
|
+ .append(renderYAxisGridLines(320, axisMax, yAxisTickStep))
|
|
|
.append(renderChartAxes(320))
|
|
.append(renderChartAxes(320))
|
|
|
.append(renderYAxisTicks(axisMax, yAxisTickStep))
|
|
.append(renderYAxisTicks(axisMax, yAxisTickStep))
|
|
|
.append(renderXAxisTickMarks(112, 208))
|
|
.append(renderXAxisTickMarks(112, 208))
|
|
@@ -343,6 +344,7 @@ public class ClasspathOutlookExamSprintReportRenderer implements ExamSprintRepor
|
|
|
.append("<div class='chart-box'>")
|
|
.append("<div class='chart-box'>")
|
|
|
.append("<svg class='high-frequency-column-chart'").append(SVG_CJK_FONT_FAMILY)
|
|
.append("<svg class='high-frequency-column-chart'").append(SVG_CJK_FONT_FAMILY)
|
|
|
.append(" xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 220' role='img' aria-label='常考词汇掌握情况'>")
|
|
.append(" xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 220' role='img' aria-label='常考词汇掌握情况'>")
|
|
|
|
|
+ .append(renderYAxisGridLines(360, axisMax, 20))
|
|
|
.append(renderChartAxes(360))
|
|
.append(renderChartAxes(360))
|
|
|
.append(renderYAxisTicks(axisMax, 20))
|
|
.append(renderYAxisTicks(axisMax, 20))
|
|
|
.append(renderXAxisTickMarks(97, 187, 277))
|
|
.append(renderXAxisTickMarks(97, 187, 277))
|
|
@@ -386,6 +388,7 @@ public class ClasspathOutlookExamSprintReportRenderer implements ExamSprintRepor
|
|
|
.append("<div class='chart-box'>")
|
|
.append("<div class='chart-box'>")
|
|
|
.append("<svg class='frequency-band-column-chart'").append(SVG_CJK_FONT_FAMILY)
|
|
.append("<svg class='frequency-band-column-chart'").append(SVG_CJK_FONT_FAMILY)
|
|
|
.append(" xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 220' role='img' aria-label='词频区间掌握度'>")
|
|
.append(" xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 220' role='img' aria-label='词频区间掌握度'>")
|
|
|
|
|
+ .append(renderYAxisGridLines(360, axisMax, 50))
|
|
|
.append(renderChartAxes(360))
|
|
.append(renderChartAxes(360))
|
|
|
.append(renderYAxisTicks(axisMax, 50))
|
|
.append(renderYAxisTicks(axisMax, 50))
|
|
|
.append(renderXAxisTickMarks(97, 187, 277));
|
|
.append(renderXAxisTickMarks(97, 187, 277));
|
|
@@ -558,6 +561,22 @@ public class ClasspathOutlookExamSprintReportRenderer implements ExamSprintRepor
|
|
|
.toString();
|
|
.toString();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private String renderYAxisGridLines(int width, int axisMax, int tickStep) {
|
|
|
|
|
+ if (axisMax <= 0 || tickStep <= 0) {
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ StringBuilder builder = new StringBuilder();
|
|
|
|
|
+ for (int tickValue = 0; tickValue <= axisMax; tickValue += tickStep) {
|
|
|
|
|
+ int y = CHART_AXIS_BOTTOM - (int) Math.round((tickValue / (double) axisMax) * CHART_AXIS_HEIGHT);
|
|
|
|
|
+ builder.append("<line class='chart-grid-line chart-grid-line-y' x1='")
|
|
|
|
|
+ .append(CHART_AXIS_LEFT).append("' y1='").append(y)
|
|
|
|
|
+ .append("' x2='").append(width - 24).append("' y2='").append(y)
|
|
|
|
|
+ .append("' stroke='#edf2f7' stroke-width='1'/>");
|
|
|
|
|
+ }
|
|
|
|
|
+ return builder.toString();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private String renderYAxisTicks(int axisMax, int tickStep) {
|
|
private String renderYAxisTicks(int axisMax, int tickStep) {
|
|
|
if (axisMax <= 0 || tickStep <= 0) {
|
|
if (axisMax <= 0 || tickStep <= 0) {
|
|
|
return "";
|
|
return "";
|