Skip to content

Commit

Permalink
Allow null/undefined co-ords in legend
Browse files Browse the repository at this point in the history
v1.01 - Some external code had been written with required parameters
missing from addLegend.  This fix is to allow these charts to continue
to work.
  • Loading branch information
johnkiernander committed Sep 5, 2013
1 parent bc6abe6 commit 04a81a8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion dist/dimple.v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -3884,7 +3884,9 @@ var dimple = {
// Source: /src/methods/_parsePosition.js
dimple._parsePosition = function (value, svgScaleValue) {
var returnValue = value;
if (!isNaN(value)) {
if (value === undefined || value === null) {
returnValue = 0;
} else if (!isNaN(value)) {
returnValue = value;
} else if (value.slice(-1) === "%") {
returnValue = svgScaleValue * (parseFloat(value.slice(0, value.length - 1)) / 100);
Expand Down
2 changes: 1 addition & 1 deletion dist/dimple.v1.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dimple",
"version": "1.0.0",
"version": "1.0.1",
"private": true,
"licenses": [
{
Expand Down
4 changes: 3 additions & 1 deletion src/methods/_parsePosition.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// Source: /src/methods/_parsePosition.js
dimple._parsePosition = function (value, svgScaleValue) {
var returnValue = value;
if (!isNaN(value)) {
if (value === undefined || value === null) {
returnValue = 0;
} else if (!isNaN(value)) {
returnValue = value;
} else if (value.slice(-1) === "%") {
returnValue = svgScaleValue * (parseFloat(value.slice(0, value.length - 1)) / 100);
Expand Down

0 comments on commit 04a81a8

Please sign in to comment.