Modify ↓
Opened 12 years ago
Last modified 7 years ago
#11700 new enhancement
null values
| Reported by: | Owned by: | ||
|---|---|---|---|
| Priority: | normal | Component: | VisualizationPlugin |
| Severity: | normal | Keywords: | |
| Cc: | Trac Release: | 1.0 |
Description (last modified by )
When data contains nulls like:
| Sp_data | Ideal | Real |
| 2013-06-22 00:00:00+02:00 | 39 | 39 |
| 2013-06-22 00:00:00+02:00 | 39 | |
| 2013-06-23 00:00:00+02:00 | 36 | |
| 2013-06-24 00:00:00+02:00 | 33 | 32 |
error is raised:
All series on a given axis must be of the same data type
when null value is replaced by exact value ex:
| Sp_data | Ideal | Real |
| 2013-06-22 00:00:00+02:00 | 39 | 39 |
| 2013-06-22 00:00:00+02:00 | 1 | 39 |
| 2013-06-23 00:00:00+02:00 | 36 | 1 |
| 2013-06-24 00:00:00+02:00 | 33 | 32 |
chart is ok
I added to [vis] in trac.ini:
options = interpolateNulls:true
but result is the same as without this line.
Attachments (0)
Change History (3)
comment:1 Changed 12 years ago by
| Description: | modified (diff) |
|---|
comment:2 Changed 11 years ago by
comment:3 Changed 7 years ago by
| Owner: | Rob Guttman deleted |
|---|
Note: See
TracTickets for help on using
tickets.



Two causes:
All series on a given axis must be of the same data typeerror. Workaround: first row cannot have null in non-string column.function
populate(viz.js) will initialize DataTable with Col1 (date), Col2 (numeric), Col3 (numeric). First row will be added properly. Second will be skipped because Col2 = null, which is deduced as string - see line:if (isNaN(value)) { // not a number, assume a string value = raw; type = 'string'; }because of line:
if (type != data.getColumnType(j)) goodrow = false;row is marked as invalid
I used workaround by adding one condition:
// if first row, add the columns if (i==0) data.addColumn(type, columns[j]); else if (raw == '') { value = null; goodrow = true; } else if (type != data.getColumnType(j)) goodrow = false;This is not the solution for the point 1 (types) but solves the second (null)