Commit ab628560 authored by Kjetil Thuen's avatar Kjetil Thuen
Browse files

Added labels for y axis. Up side down though :/

parent a3c2b230
......@@ -47,13 +47,20 @@ xAxis = (chartId) ->
.orient "bottom"
.ticks 5
yAxis = (chartId) ->
yAxisGrid = (chartId) ->
d3.svg.axis()
.scale yScale chartId
.orient "right"
.tickSize chartWidth(chartId) * 2
.ticks 100
yAxisLabels = (chartId) ->
d3.svg.axis()
.scale yScale chartId
.orient "right"
.ticks 5
prepareMetadataDiv = (chartId, data, mapping) ->
if data
fieldMapping = mapping or {
......@@ -248,10 +255,15 @@ setupChart = (chartId, data, displayDetails) ->
gy = svg.append "g"
axesGroup = svg.append "g"
.attr "class", "yAxisGroup"
.call yAxis(chartId)
svg.append "g"
.attr "class", "yAxisGrid"
.call yAxisGrid(chartId)
svg.append "g"
.attr "class", "yAxisLabels"
.attr "transform", (d, i) ->
"translate(" + (chartWidth(chartId) / 2 - 15) + ", 0)"
.call yAxisLabels(chartId)
metadata = d3.select chartId
.append "div"
......
......@@ -27,7 +27,17 @@ div.chartContainer {
position: relative;
}
.yAxisGroup {
.yAxisLabels {
path, line {
display: none;
}
text {
fill: black;
}
}
.yAxisGrid {
path {
display: none;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment