Skip to content

Bar chart: the highest form are incorrect on bars. #1

@4surix

Description

@4surix

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.

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.

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions