});
it('sets the size', function () {
- var svg = buildSvg();
+ var svg, radarGraph;
+ svg = buildSvg();
spyOn(svg, 'attr').andReturn(svg);
- var radarGraph = new tr.graphing.Radar(svg, 500, radar);
+ radarGraph = new tr.graphing.Radar(svg, 500, radar);
expect(svg.attr).toHaveBeenCalledWith('width', 500);
expect(svg.attr).toHaveBeenCalledWith('height', 500);
describe('lines', function () {
it('plots a vertical line in the center', function () {
- var svg = buildSvg();
+ var svg, radarGraph;
+
+ svg = buildSvg();
spyOn(svg, 'append').andReturn(svg);
spyOn(svg, 'attr').andReturn(svg);
- var radarGraph = new tr.graphing.Radar(svg, 500, radar);
+ radarGraph = new tr.graphing.Radar(svg, 500, radar);
radarGraph.plot();
});
it('plots a horizontal line in the center', function () {
- var svg = buildSvg();
+ var svg, radarGraph;
+
+ svg = buildSvg();
spyOn(svg, 'append').andReturn(svg);
spyOn(svg, 'attr').andReturn(svg);
- var radarGraph = new tr.graphing.Radar(svg, 500, radar);
+ radarGraph = new tr.graphing.Radar(svg, 500, radar);
radarGraph.plot();