Title for charts and axes in dimple.js charts
2 answers
You can add a header with a little d3. Here is an example of a center name. For simplicity, I've put the style in d3, but it would probably be neater to give it a class and set the styles in css:
svg.append("text")
.attr("x", c._xPixels() + c._widthPixels() / 2)
.attr("y", c._yPixels() - 20)
.style("text-anchor", "middle")
.style("font-family", "sans-serif")
.style("font-weight", "bold")
.text("My brilliant chart about a and b");
+8
source to share
John's answer is awesome, but couldn't you use the dimple function for titleShape? If you define your axes as "x" and "y" you can simply do:
x.titleShape.text("your x axis title");
y.titleShape.text("your y axis title");
If you don't define axes, then using d3 as John has shown is probably the best way to go.
+2
source to share