.attr('x2', size / 2)
.attr('y2', size)
.attr('stroke-width', 5);
+
+ svg.append('line')
+ .attr('x1', 0)
+ .attr('y1', size / 2)
+ .attr('x2', size)
+ .attr('y2', size / 2)
+ .attr('stroke-width', 5);
};
self.plot = function () {
expect(svg.attr).toHaveBeenCalledWith('y2', 500);
expect(svg.attr).toHaveBeenCalledWith('stroke-width', 5);
});
+
+ it('plots a horizontal line in the center', function () {
+ var svg = buildSvg();
+ spyOn(svg, 'append').andReturn(svg);
+ spyOn(svg, 'attr').andReturn(svg);
+
+ var radarGraph = new tr.graphing.Radar(svg, 500);
+
+ radarGraph.plot();
+
+ expect(svg.append).toHaveBeenCalledWith('line');
+ expect(svg.attr).toHaveBeenCalledWith('x1', 0);
+ expect(svg.attr).toHaveBeenCalledWith('y1', 500 / 2);
+ expect(svg.attr).toHaveBeenCalledWith('x2', 500);
+ expect(svg.attr).toHaveBeenCalledWith('y2', 500 / 2);
+ expect(svg.attr).toHaveBeenCalledWith('stroke-width', 5);
+ });
})
});