Created
August 5, 2014 01:29
-
-
Save AndyMoreland/8f22472a6a9a1fe8be90 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = | |
class LineView extends VisualizationView | |
tagName: 'div' | |
_renderToContext: (context) => | |
@_drawLines context, @reportPresenter.getLineData() | |
_drawLines: (context, data) -> | |
x = @axisProvider.getXScale(@renderBounds) | |
y = @axisProvider.getYScale(@renderBounds) | |
line = d3.svg.line() | |
.x (d) -> x(d.key) | |
.y (d) -> y(d.value) | |
context | |
.selectAll('.series') | |
.data(data) | |
.enter() | |
.append 'path' | |
.attr 'class', 'series' | |
.attr 'd', line | |
.attr 'fill', 'none' # remove | |
.attr 'stroke', 'black' # remove |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment