Closed Calvein closed 9 years ago
Hello @Calvein,
xAlignment()
and yAlignment()
are used for aligning Component
s within cells, not changing the direction of the Plot
. To reverse the direction of a Plot
, pass its Scale
a reversed domain:
You'll also need to use separate X Scale
s for the two Plot
s. An alternative method is to plot one set of data as though it were negative, use a single X Scale
and Axis
, and use a formatter to display the absolute value:
As to your other requests, we currently have API points for attaching callbacks that get invoked when the Component
is anchor()
ed and detach()
ed. I think it'd be a good idea to add an API for callbacks after rendering, although when animations are enabled it's possible that the callbacks would fire before the rendering is fully complete.
Thanks for this :)
I'm closing this issue, I'll let you create new ones if you think that the API changes I was talking about are pertinent.
I'm testing Plottable by doing a population pyramid chart and I came across some issues, first off, here is my code:
As you may know, a population pyramid is just 2 bar plots, one against the other, the first one being read from the center to the left and the second one from the center to the right. That's my first problem here, I can't set the first plot (
maleChart
in my example) to be read from left to right, I tried to usexAlignment
but it didn't change anything. I added theonAnchor
method to edit it after it's being build, I wanted to get its element (the<g class="component">
) and turn it by changing it's x scale to -1, but I can't get the component directly, only the entities, maybe aselection
method that returns it could fix it ?Even if this would have work, I was still going to have a problem since my chart is responsive. I can sure call
chart.redraw()
(which is awesome btw) but there isn't any event on mymaleChart
that tells me when it has been redrawn.