KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

HTML Entities in Labels #3460

Closed Wayland Games opened this topic on 5 days ago - 4 comments

Wayland Games commented 5 days ago

Hi,

I'm getting HTML entities in labels for pie charts and doughnut charts (probably affects all charts) when using single quote marks and ampersands.

I thought it was my data being encoded at first but after ensuring all entities were decoded they're still rendering as encoded.

Could this be fixed please?

Thanks in advance, Sam

Sebastian Morales commented 5 days ago

Pls let us know the chart class including namespace that you were using. Tks,

Wayland Games commented 4 days ago

koolreport\dashboard\widgets\google\PieChart;

koolreport\dashboard\widgets\google\DonutChart;

Looks like it's Google Dashboard widgets

Sebastian Morales commented 2 days ago

This seems to be because Dashboard's Google charts converts label field value using html entities encode function. You can disable the auto conversion by set the label field prop html like this:

protected function fields()
    {
        return [
            Text::create("category")->html(true), // set the chart label field's html prop to be true
            Currency::create("profit")
                ->USD()->symbol()
                ->decimals(0),
        ];
    } 

Let us know this works for you. Rgds,

Wayland Games commented 1 day ago

Excellent! That solved it. Thank you :)

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
solved

None