Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions app/export/exporteur.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from os.path import abspath, isdir, join
from json import dump
from altair import Chart
from altair import Chart, Theta, Color
from pandas import DataFrame


Expand Down Expand Up @@ -110,15 +110,20 @@ def export_vers_html_camembert(self,
# Exportation
try:
chemin_fichier = join(self._chemin_sortie, nom_fichier)
camembert = Chart(axes).mark_arc().encode(
theta='y:Q',
color='x:N',
base = Chart(axes).encode(
theta=Theta(field="y", type="quantitative"),
color=Color(field="x", type="nominal"),
tooltip=['x:N', 'y:Q']
)
camembert.save(chemin_fichier)
camembert = base.mark_arc(outerRadius=200)
graphique = (camembert).properties(
width=400,
height=400
)
graphique.save(chemin_fichier)
except Exception as ex:
raise ExportationCamembertHtmlException("Erreur lors de l'exportation "
f"du camembert {nom_fichier}.") from ex
f"du camembert {nom_fichier} {ex}.") from ex


class ExportationException(Exception):
Expand Down