瀏覽代碼

Cap right axis labels in previous year production comparison to 20

Neal Wilson 9 年之前
父節點
當前提交
5894cf9bfd
共有 1 個文件被更改,包括 8 次插入3 次删除
  1. 8
    3
      config/Reports/chart.xml

+ 8
- 3
config/Reports/chart.xml 查看文件

@@ -162,7 +162,7 @@
162 162
                     query.exec(q);
163 163
                     if(query.next())
164 164
                     {
165
-                        curpounds[i] = query.value(0);
165
+                        curpounds[i] = Number(query.value(0));
166 166
                     }
167 167
                     else
168 168
                     {
@@ -172,7 +172,7 @@
172 172
                     query.exec(q);
173 173
                     if(query.next())
174 174
                     {
175
-                        prevpounds[i] = query.value(0);
175
+                        prevpounds[i] = Number(query.value(0));
176 176
                     }
177 177
                     else
178 178
                     {
@@ -347,6 +347,11 @@
347 347
                     i += increment;
348 348
                 }
349 349
                 i = miny2;
350
+                var stepSize = 0.1;
351
+                while((maxy2 - miny2) / stepSize > 20)
352
+                {
353
+                    stepSize += 0.05;
354
+                }
350 355
                 while(i <= maxy2)
351 356
                 {
352 357
                     output.writeStartElement("text");
@@ -355,7 +360,7 @@
355 360
                     output.writeAttribute("font-size", "12");
356 361
                     output.writeCharacters(Number(i*100).toFixed(0)+"%");
357 362
                     output.writeEndElement();
358
-                    i += 0.1;
363
+                    i += stepSize;
359 364
                 }
360 365
                 i = 0;
361 366
                 while(i <= days-1)

Loading…
取消
儲存