pranjal-goswami / multifact-pivottable

A JavaScript plugin for PivotTable.js. It renders multiple aggregations simultaneously with added configurations for rendering beautiful tables http://pranjalgoswami.in/multifact-pivottable/examples/index.html
MIT License
18 stars 13 forks source link

Formatter does not work for more than one derived aggregations #10

Closed ilitty closed 3 years ago

ilitty commented 3 years ago

Hello and thank you for that fabulous library.

I have a problem with formatting my derived aggregations. When I try to format them a percent it does not work. It works only for the first one. Please note that Productivity and Quality do not have to be multiplied by 100. I just want to add a suffix %.

I would be really grateful if you can help me.

An example of my code:

 var derivedAggregations = [
        {
            name : 'Utilization %',
            description : 'Utilization %',
            expression : 'variables.f*100',
            renderEnhancement : 'barchart',
            barchartColor : '#fa983a',
            formatterOptions : {
                digitsAfterDecimal: 1,
                scaler: 1,
                suffix: "%"
            }
        },
        {
            name : 'Productivity %',
            description : 'Performance',
            expression : 'variables.g',
            renderEnhancement : 'barchart',
            barchartColor : '#fa983a',
            formatterOptions : {
                digitsAfterDecimal: 1,
                scaler: 1,
                suffix: "%"
            }
        },
        {
            name : 'Quality %',
            description : 'Quality',
            expression : 'variables.h',
            renderEnhancement : 'barchart',
            barchartColor : '#fa983a',
            formatterOptions : {
                digitsAfterDecimal: 1,
                scaler: 1,
                suffix: "%"
            }
        }
    ];`
ilitty commented 3 years ago

Hi again! Don't mind my issue. I found the problem and it was in my code!

Thanks again!