-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Explanation
In the bar chart, the upper part of the bars does not reflect the true value.
The solid parts (█) of the bars are mostly used, not ▄ and _.
This is due to incorrect writing of the conditions.
Regarding the condition where the value is equal.
The variables valeur_y and ligne_valeur_y are mostly decimal numbers. Sometimes these two variables are close, but not equal. Let's change the condition to take this into account.
cliagramme/cliagramme/baton.py
Lines 244 to 249 in 57db5b8
| elif valeur_y == ligne_valeur_y: | |
| ligne += ( | |
| CARAC_BARRE_H_EGA_COULEUR[index_baton] if couleur | |
| else | |
| CARAC_BARRE_H_EGA | |
| ) |
The part elif valeur_y == ligne_valeur_y: must be replaced with elif ligne_valeur_y - 1 < valeur_y < ligne_valeur_y + 1:.
Regarding the condition where the value is lower.
Here, the condition only applies if the bar in the diagram is lower than the first visible value on the y-axis. It must be valid for any size of bar.
cliagramme/cliagramme/baton.py
Lines 251 to 257 in 57db5b8
| elif (min_valeur_y + palier >= ligne_valeur_y | |
| and valeur_y != min_valeur_y): | |
| ligne += ( | |
| CARAC_BARRE_H_INF_COULEUR[index_baton] if couleur | |
| else | |
| CARAC_BARRE_H_INF | |
| ) |
The part elif (min_valeur_y + palier >= ligne_valeur_y must be replaced with elif (valeur_y < ligne_valeur_y.