diff --git a/packages/charts-vanilla-radar/src/scripts/data.js b/packages/charts-vanilla-radar/src/scripts/data.js index cfc38c7..1e52c32 100644 --- a/packages/charts-vanilla-radar/src/scripts/data.js +++ b/packages/charts-vanilla-radar/src/scripts/data.js @@ -6,14 +6,18 @@ const data = [ {axis:'Memory', value:0.54}, {axis:'CPU', value:0.38}, {axis:'Disk', value:0.23}, + {axis:'Network', value:0.23}, + {axis:'Heap', value:0.16}, ], [//Samsung - {axis:'Apdex', value:0.80}, + {axis:'Apdex', value:0.58}, {axis:'Alerts', value:0.66}, {axis:'Request Volume', value:0.35}, {axis:'Memory', value:0.23}, {axis:'CPU', value:0.36}, {axis:'Disk', value:0.13}, + {axis:'Network', value:0.11}, + {axis:'Heap', value:0.35}, ], [//Nokia Smartphone {axis:'Apdex', value:0.26}, @@ -22,5 +26,7 @@ const data = [ {axis:'Memory', value:0.14}, {axis:'CPU', value:0.22}, {axis:'Disk', value:0.04}, + {axis:'Network', value:0.23}, + {axis:'Heap', value:0.41}, ], ]; \ No newline at end of file diff --git a/packages/charts-vanilla-radar/src/scripts/index.js b/packages/charts-vanilla-radar/src/scripts/index.js index 828f879..4f16611 100644 --- a/packages/charts-vanilla-radar/src/scripts/index.js +++ b/packages/charts-vanilla-radar/src/scripts/index.js @@ -56,7 +56,7 @@ class Radar { let g = blobs.append('g').attr('class', 'blob-' + i); g.append('path').datum(data[i]).attrs({ 'stroke-width': 1.5, - 'd' : a.line, + 'd' : this.line, 'fill': () => { return this.color(i); }, }); @@ -101,7 +101,7 @@ class Radar { // draws the axis if (this.cfg.axisStyle) { - this.axisGroup = globalGroup.append('g').attr('class','axis-lines'); + this.axisGroup = globalGroup.append('g').attr('class', 'axis-lines'); this.axisGroup.selectAll('.axis-line').data(this.axis.names).enter().append('line') .attrs({ 'x1': 0, @@ -121,7 +121,7 @@ class Radar { if (this.cfg.shape == 'circle') { //draw rings let ringInterval = this.cfg.max / this.cfg.levels; - var ringRadiusValues = d3.range(ringInterval, this.cfg.max + 1, ringInterval).reverse() //add 1 so you include the MAX + let ringRadiusValues = d3.range(ringInterval, this.cfg.max + 1, ringInterval).reverse(); let g = globalGroup.append('g').attr('class', 'grid-circle'); g.append('g').attr('class', 'rings') @@ -197,16 +197,16 @@ class Radar { //Wraps SVG text wrap(text, width) { text.each(function() { - var text = d3.select(this), - words = text.text().split(/\s+/).reverse(), - word, - line = [], - lineNumber = 0, - lineHeight = 1.4, // ems - y = text.attr('y'), - x = text.attr('x'), - dy = parseFloat(text.attr('dy')) || 0, - tspan = text.text(null).append('tspan').attr('x', x).attr('y', y).attr('dy', dy + 'em'); + let text = d3.select(this); + let words = text.text().split(/\s+/).reverse(); + let word; + let line = []; + let lineNumber = 0; + let lineHeight = 1.4; // ems + let y = text.attr('y'); + let x = text.attr('x'); + let dy = parseFloat(text.attr('dy')) || 0; + let tspan = text.text(null).append('tspan').attr('x', x).attr('y', y).attr('dy', dy + 'em'); while (word = words.pop()) { line.push(word);