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
Make ImageGraph BackgroundColor / TextColor customizable #3799
Comments
New mobile app with pretty graphs FTW |
Attachment: |
Graph does not have to look like the attachment but would be great to be able to set backgroundColor, textColor and axisColor to those colors via URL parameter. @julienm do you think you'll find some time to implement this in the next 4-6 weeks? Otherwise I'll maybe have a look at it |
Yes I can have a look at it. Could you give me examples of colors for each parameter? Also, will you need to specify transparency for the background (and eventually for the other parameters) ? |
Also, should it be possible to set the legend font color differently from the axes values font color? |
I have committed in my repo three new ImageGraph API parameters $textColor, $backgroundColor and $gridColor : https://github.com/JulienMoumne/piwik/commit/cd811234e4b838f651ef0ef5d1218175e19d204d If you can, do tell me if this is what you are looking for. |
sure! backgroundColor = #efefef I don't need to be able to change the different line colors of the evolution graph. |
oh cool! Thx for working on that so fast. I will test it tomorrow. |
From what I see you may need more granularity than what I implemented. Do tell me after testing if this is the case. |
Looks good so far! Aweseome! See attachment piwikGraph_1.png. The only missing thing I need in addition is to be able to change the color of a line / bar (which is currently blue by default). I need to set it to "#cb2026". I need to change it only for static graphs, not for evolution graphs where 5 or 6 different colors are used. |
Attachment: |
To change the color of the line and/or bars, try to use &colors=FF00FF on my branch commit. |
Works perfect! You made my day! Thanks! BTW: Not sure if it is related: When using this url to generate the graph: I'm getting this error which seems to only occur when graph is an evolution graph:
Link to that file: |
Try this https://github.com/JulienMoumne/piwik/commit/d189d5a29a3b4fd4f938bd180fee7aa72e8c5cce You will still have an exception but this time it will be more explicit. |
Seems to be fixed. The following error message is displayed within the graph now:
But that's another issue which has nothing to do with the colors (API should not return an evolution graph url for this report). Refererrs.getRefererType works fine. |
It seems there is an issue with metadata indeed. Could you create a separate ticket for the metadata issue? Concerning the current ticket, could you confirm you have all you needed and that we can commit and close the ticket? |
I can confirm I have all I needed. Thx again! Will open a separate ticket for the other metadata issue. |
excellent, I can't wait to see the new graphs that result of this ;-) |
@julien I found a small issue... which isn't highly critical. The backgroundColor is not applied if an error message like "No data for this graph" is displayed. See for instance this url: The backgroundColor should be "#efefef" instead of white. |
thx! |
huh |
Make backgroundColor, textColor and axisColor of a graph customizable via URL parameters.
This is interesting for new mobile app.
The text was updated successfully, but these errors were encountered: