- var dataset = this.datasets[setName];
- for (var j = 0; j < dataset.length; j++) {
- var item = dataset[j];
- var point = {
- x: ((parseFloat(item[0]) - this.minxval) * this.xscale),
- y: 1.0 - ((parseFloat(item[1]) - this.minyval) * this.yscale),
- xval: parseFloat(item[0]),
- yval: parseFloat(item[1]),
- name: setName
- };
-
- // limit the x, y values so they do not overdraw
- if (point.y <= 0.0) {
- point.y = 0.0;
- }
- if (point.y >= 1.0) {
- point.y = 1.0;
- }
- if ((point.x >= 0.0) && (point.x <= 1.0)) {
- this.points.push(point);
- }
- }
+ if (this.datasets.hasOwnProperty(setName)) {
+ var dataset = this.datasets[setName];
+ for (var j = 0; j < dataset.length; j++) {
+ var item = dataset[j];
+ var point = {
+ x: ((parseFloat(item[0]) - this.minxval) * this.xscale),
+ y: 1.0 - ((parseFloat(item[1]) - this.minyval) * this.yscale),
+ xval: parseFloat(item[0]),
+ yval: parseFloat(item[1]),
+ name: setName
+ };
+
+ // limit the x, y values so they do not overdraw
+ if (point.y <= 0.0) {
+ point.y = 0.0;
+ }
+ if (point.y >= 1.0) {
+ point.y = 1.0;
+ }
+ if ((point.x >= 0.0) && (point.x <= 1.0)) {
+ this.points.push(point);
+ }
+ }
+ }