Dimension label positions
jmgelman opened this issue · 2 comments
It seems like the dimension title positions are hard-coded to be at the top of the axes:
// Add an axis and title.
g.append("svg:g")
.attr("class", "axis")
.attr("transform", "translate(0,0)")
.each(function(d) { d3.select(this).call( pc.applyAxisConfig(axis, __.dimensions[d]) )
})
.append("svg:text")
.attr({
"text-anchor": "middle",
"y": 0,
"transform": "translate(0,-5) rotate(" + __.dimensionTitleRotation + ")",
"x": 0,
"class": "label"
})
In my case, I need the dimension titles to be at the bottom of the parallel axes, not the top. So to do this, I changed the value of the "y" position to be what I need it to be (it gets adjusted dynamically if the element that holds my plot is resized).
But obviously, "hacking" the library to do this is undesired. It'd be much nicer to set this as part of the dimension
object. To either have the titles appear at the top or bottom of the axes.
I just want to make sure this isn't already do-able somehow though, and perhaps I missed it?
Thanks!
You could re-position the labels after the axes have been created. Something like this:
d3.selectAll(".parcoords .label").attr("y", chartHeight)
Nice! Thanks for the advice.