Open tcash21 opened 11 years ago
Here is an example on how to add custom x-axis labels in Rickshaw. You can use ViewSource to check out the underlying code.
In rCharts, the basic idea would be to pass a tickFormat
function, which would then adjust the labels accordingly. I will try to post an example later, but this should get you started on the right track.
Thanks, I saw that but was hoping there was just a simple x and y-axis title parameter. I'll give this a try though!
I am reopening this issue so that it serves me as a reminder to provide a simpler mechanism to specify axis labels. It should be fairly straightforward to generate the javascript formatter function from a vector of labels specified by the user.
Cool, thanks. I was hoping for a way to provide custom tick labels but also just a generic label specifying what the measure actually is, but as far as I can tell Rickshaw only lets you label the ticks.
You might want to post a question on the github repo for Rickshaw, asking what is the best way to add a title. Once we figure that out, it should be straightforward to integrate into rCharts.
They purposely didn't put in axis labels. You're supposed to do it on your own. Google Visualization API allows easy addition of axis labels but it isn't open source and you can't host it on your own server.
Thanks @Raindrop11. This is good to know. Any thoughts on how to implement this with Rickshaw? Once we figure out the JS side of things, I can incorporate it into rCharts
.
It depends on how you want the axis labels to look like. I'm guessing that the best example would be how Google Visualization API does it, because I'm sure their talented designers spent time and energy to design it well.
Example of Google Visualization API's axis labels:
I've searched through the Rickshaw code examples and rCharts code but have not been able to find any documentation on adding x and y-axis labels or main chart titles?
Is this possible within the Rickshaw chart object itself since adding text in R shiny is a bit clunky and requires a bunch of CSS formatting?