You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.
I have started using the code here for an application which will go live in a few months time.
Currently the charts only allow captions but does not allow labels and legends. Can we have this feature set added to the same or if you could suggest a workaround.....
The text was updated successfully, but these errors were encountered:
I think the right thing to do here is to add the legend/label directly (http://bl.ocks.org/ZJONSSON/3918369 for an example). You don't really need to wire them up to the backbone MVC stuff, unless you're planning for them to be data driven.
You might want to look at rickshaw or nvd3 - both are much better in terms of feature set and are easily integrated with Backbone (which is why this project hasn't seen much in the way of updates recently)
Thanks Simon. The labels need to be data driven. Currently successful in rendering captions in the following manner (for bar charts)
chart.selectAll("rect")
.data(data)
.enter().append("svg:rect")
.attr("x", function(d, i) { return x(i) - .5; })
.attr("y", function(d) { return yval(d) })
.attr("width", w)
.append("svg:title")
.text(function(d) {
return d.x;
})
.attr("height",
function(d) { return scale * d.y; });
I do not want to hard code the text in the bar.js nor would like to send an additional attribute to the Javascript. Adding something in this fashion works... but is not what is needed...
chart.append("text")
.attr("class", "y label")
.attr("text-anchor", "end")
.attr("y", 6)
.attr("dy", ".75em")
.attr("transform", "rotate(-90)")
.text("Test Y Axis");
Is there an alternative route to rendering labels inside the bar.js ......
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have started using the code here for an application which will go live in a few months time.
Currently the charts only allow captions but does not allow labels and legends. Can we have this feature set added to the same or if you could suggest a workaround.....
The text was updated successfully, but these errors were encountered: