Ticket #8108 (reopened defect)
straight line graphs with no axes don't show up
| Reported by: | nazanin | Owned by: | elazutkin |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.3 |
| Component: | Charting | Version: | 1.2.1 |
| Severity: | normal | Keywords: | straight line graph |
| Cc: | nazanin@… |
Description
1. Create a graph with no axes with these values: (0,10), (1,10),(2,10),(3,10),..
Result: the graph doesn't show up since the max y value minus min y value becomes zero and scale which is span/(max - min) will become NaN.
Fixed it with this patch:
--- a/public/javascripts/dojotoolkit/dojox/charting/scaler/primitive.js
+++ b/public/javascripts/dojotoolkit/dojox/charting/scaler/primitive.js
@@ -2,13 +2,17 @@ dojo.provide("dojox.charting.scaler.primitive");
dojox.charting.scaler.primitive = {
buildScaler: function(/*Number*/ min, /*Number*/ max, /*Number*/ span, /*Object*/ kwArgs){
+ if (min == max)
+ scale = min;
+ else
+ scale = span/(max - min);
return {
bounds: {
lower: min,
upper: max,
from: min,
to: max,
- scale: span / (max - min),
+ scale: scale,
span: span
},
scaler: dojox.charting.scaler.primitive
Change History
Note: See
TracTickets for help on using
tickets.