Skip to content
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

Titles/labels and the graphs in Charging stats does not match #814

Closed
petariga opened this issue Jun 28, 2020 · 5 comments
Closed

Titles/labels and the graphs in Charging stats does not match #814

petariga opened this issue Jun 28, 2020 · 5 comments
Labels
area:grafana Related to Grafana

Comments

@petariga
Copy link

petariga commented Jun 28, 2020

Describe the bug
It is just a nuance. When you look at the “Charging stats” in Grafana the pie chart of the AC/DC split has the AC value on the right (green) and DC value on the left (yellow), however the title of the chart states “AC/DC - kWh”, so from the first look you expect the AC on the left and DC on the right. The same vice versa expectation is for the “AC/DC - Duration”.

Expected behavior
If the pie chart title states AC/DC, then the circle chart should have AC charges on the left and DC charges on the right (regardless of the color chosen).

Screenshots

54752521-3EDF-4754-A374-C065794D11A4
99AF5E45-26D4-4084-A3FE-085D61FB6A3E

Environment

  • TeslaMate version: 1.19.3
  • Type of installation: Docker
  • OS TeslaMate is installed on: Linux
  • User OS & Browser: any
  • Others:
@petariga petariga changed the title Texts/labels and the graphs in Charging stats does not match Titles/labels and the graphs in Charging stats does not match Jun 28, 2020
@adriankumpf adriankumpf added the area:grafana Related to Grafana label Jun 29, 2020
adriankumpf added a commit that referenced this issue Oct 24, 2020
…now match pie-charts in Charging stats (#998)

* new dashboard for reporting to Dutch tax

based on #989

* Titles/labels now match pie-charts in Charging stats

Solves #814 - just had to reverse the "ORDER BY" for the pie-charts...

* Include reports in Docker image

* Use new table component

* Show geo fences where applicable

Closes #989 
Fixes #814

Co-authored-by: Adrian Kumpf <[email protected]>
@petariga
Copy link
Author

petariga commented Oct 26, 2020

I don't want to be too picky, but I have just seen the result in the version 1.20.1 and I think that there is still a way to improve @roadrash2108 @adriankumpf .

Previously, AC was green and DC was yellow, which was correct in my opinion (AC is better for the battery life, then I would expect it to use the green color). Now the colors are vice versa. The title and the order in the pie graph match, this is correct (left AC, right DC), however when you look under the pie graphs, the two rows with description are now vice versa - the first row is DC, the second is AC. The previous order was correct - first AC and then DC (the same is in the title of the graph and in the pie graph), now it has changed to the exact opposite.

So one problem was solved and another two were introduced...

image
image

@roadrash2108
Copy link
Contributor

roadrash2108 commented Oct 27, 2020

I will look into it.

@petariga in case you have a docker-installation of your TeslaMate consider changing the grafana-part to "edge", so that you get the latest changes before the release and can give early feedback.

UPDATE: I've found and fixed the color-problem. Regarding the sorting there seems the fixed order, that pie-charts always are filled clockwise - you can test this when sorting by clicking on the headers in the leged (e.g. "total" or "percentage"). I will look into it if I can find more.

@roadrash2108
Copy link
Contributor

So, here the summary of my investigation:

  • Grafana uses the plugin piechart-panel for the pie-chart
  • the piechart-panel plugin embeds flot (a jQuery library) for drawing the pie-chart
  • within Flot the direction of the Pie-chart is hardcoded to be clockwise

So having AC on the left would mean:

  1. making the direction of drawing pie-charts in Flot parameterize-able
  2. embed the new version of Flot into the piechart-plugin
  3. include the new version of piechart-plugin into Grafana used by TeslaMate
  4. change the dashboard of TeslaMate to use the new parameter

Seems to be a lengthy process, therefore I'm starting a PR for the colors and leave the "workaround" with the "ORDER BY ... DESC", which has the only drawback, that DC then comes before AC in the legend...

@roadrash2108
Copy link
Contributor

roadrash2108 commented Oct 28, 2020

FYI: I also created an issue here: flot/flot#1769 - let's see where this leads to...

@petariga
Copy link
Author

petariga commented Oct 28, 2020

Well done research @roadrash2108 , so the best would be to have an anticlockwise option for drawing the pie chart. I understand that this is going to take a longer while...

adriankumpf pushed a commit that referenced this issue Nov 5, 2020
* make AC always green and DC always yellow

addresses #814

* make AC-charging green and DC-charging yellow also in Trip-dashboard

to be in sync with the changes for Chargings-Stats done with #1058
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:grafana Related to Grafana
Projects
None yet
Development

No branches or pull requests

3 participants