Opened 11 years ago

Closed 10 years ago

#8056 closed defect (fixed)

Error in dojox.charting line plot when data series contains 0 or 1 entries

Reported by: Jared Jurkiewicz Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.5
Component: Charting Version: 1.2.1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Eugene Lazutkin)

From a co-worker:

Error in dojox.charting line plot when data series contains 0 or 1 entries.

I believe this results from the default span calculations. I found a similar bug for the pie chart (#6982), but nothing for line charts.

Attachments (2)

test_widget2d_0reading.html (1.8 KB) - added by Eugene Lazutkin 10 years ago.
Updated test for empty series (drop in charting/tests).
test_widget2d_1reading.html (1.8 KB) - added by Eugene Lazutkin 10 years ago.
Updated test for 1-point series (drop in charting/tests).

Download all attachments as: .zip

Change History (14)

comment:1 Changed 11 years ago by Eugene Lazutkin

Priority: highnormal
Status: newassigned

I believe this bug was fixed some time ago (after 1.2). Please attach a repro case, or close.

comment:2 Changed 11 years ago by Jared Jurkiewicz

One problem is still present in trunk, when a datastore returns 0 items/null. The chart engine errors. Testcase is: test_widget2d_0reading.html. Just drop it in the root of your dojo extract and run it.

comment:3 Changed 11 years ago by Jared Jurkiewicz

The second testcase shows that when there is only one value, the chart doesn't display properly.

comment:4 Changed 11 years ago by Eugene Lazutkin

What is expected to be seen in the second case?

comment:5 Changed 11 years ago by Eugene Lazutkin

Explaining my previous comment:

By default an axis auto-resizes using min/max values from series. If all values are the same min == max and axis is not shown, as well as bar/column/line is not shown. Because there is nothing to show (from min to max).

Typically for many cases an axis should include 0 as a min or max value (depending on other values of series). There is a special axis' parameter for that called "includeZero", which is "false" by default. In the retrospect I think it would be better to make it "true" by default, but now it is too late for that.

Even more flexibility can be afforded by specifying directly optional axis' parameters "min" and "max". Generally it is useful for dynamic charts because it allows user to see the relative changes without rescaling of the axis. Maybe your co-worker would be better with this option.

See test_chart2d.html for examples of "includeZero", "min", and "max".

comment:6 Changed 11 years ago by Eugene Lazutkin

Milestone: tbdfuture

Moving open tickets to the future.

comment:7 Changed 10 years ago by Eugene Lazutkin

Milestone: future1.4

comment:8 Changed 10 years ago by Eugene Lazutkin

Milestone: 1.41.5

bumping tickets that didn't make the 1.4 cut, but most likely to go in the next point release.

comment:9 Changed 10 years ago by Eugene Lazutkin

Description: modified (diff)

comment:10 Changed 10 years ago by Eugene Lazutkin

(In [21872]) Made sure that empty and 1-point series work properly with the default plot, thx Jared!, !strict, refs #8056.

Changed 10 years ago by Eugene Lazutkin

Attachment: test_widget2d_0reading.html added

Updated test for empty series (drop in charting/tests).

Changed 10 years ago by Eugene Lazutkin

Attachment: test_widget2d_1reading.html added

Updated test for 1-point series (drop in charting/tests).

comment:11 Changed 10 years ago by Eugene Lazutkin

Owner: changed from Eugene Lazutkin to Jared Jurkiewicz
severity: majornormal
Status: assignednew

I updated tests. 1-point series work fine now, but in the empty series test the second chart widget fails in dojox.data guts. I suspect that dojox.data.HtmlStore cannot handle empty datasets. Reassigning to Jared.

comment:12 Changed 10 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [21883]) Minor tweak to HtmlStore? to avoid null items array. fixes #8056

Note: See TracTickets for help on using tickets.