Skip to content

Set currency_prefix also in violin plot #85

Description

@futilm

It appears that FairViolinPlot is missing the currency_prefix parameter.

def _get_distribution_icon(self, model, target):
"""Create base64 icon string using FairDistributionCurve"""
fdc = FairDistributionCurve(model, self._currency_prefix)
fig, ax = fdc.generate_icon(model.get_name(), target)
img_tag = self._fig_to_img_tag(fig)
return img_tag
def _get_exceedence_curves(self, model_or_models, currency_prefix):
"""Create base64 image string using FairExceedenceCurves"""
fec = FairExceedenceCurves(model_or_models, currency_prefix)
fig, ax = fec.generate_image()
img_tag = self._fig_to_img_tag(fig)
return img_tag
def _get_violins(self, metamodel):
"""Create base64 image string using FairViolinPlot"""
vplot = FairViolinPlot(metamodel)
fig, ax = vplot.generate_image()
img_tag = self._fig_to_img_tag(fig)
return img_tag

So that when I do

report = pyfair.FairSimpleReport(report_items, currency_prefix='€')

I get euros in all the report sections except the violin plot:

Example picture:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions