-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customizeable Axis Title Rendering #3214
Comments
One idea would be to factor out a |
Thanks for the suggestion! And yes, good point, that does get a bit tricky with the API. I'll give this some thought... |
If anyone is wanting to implement this, the idea is to replace these lines with a separate function that could be overridden to provide this behaviour. Shouldn't be too hard to do, the key will be documenting the API and explicitly making this function for public use. |
Hi , Is this issue is open , i want to work on it. |
In order to make 2-axis (opposing axis) charts a bit more readable than this https://jsfiddle.net/tah74jm4/ (which line belongs to which label?), the designer wanted a color indication on the label for each line. I know there are legends, however that takes up additional space and is also not very flexible in positioning the legend items. In this case, a legend next to each label would better indicate which values belong to which line.
One option we were considering was coloring the label in the matching color of the line, however since the colors can be dynamic based on user selection, there could be colors which would make the label text hard to read. So this option was thrown out.
The option chosen was a black label with a dot next to it in the color of the line, as you can see here:
This is a screenshot of an actual graph, which I was able to generate by making a slight modification in the
draw
function incore.scale.js
in thescaleLabel.display
part:This would allow me to pass in an Array of Objects into the
labelString
as opposed to just a String. This looks like the following:Obviously, a change like that should not be done directly in the library. If I were to create a custom Scale though, I would have to override the whole
draw
function, which is not ideal either as there is a lot of code in there which might change with library versions going forward.Question is, how would I be able to implement something like this in the least intrusive way? Any suggestions would be greatly appreciated, thanks!
The text was updated successfully, but these errors were encountered: