Toggle chart multiple values

Hi,

How to show/hide the color of bar chart when I click the series name ?

Thanks

Solution

Hi Ayu,

By default, clicking is disabled by the Platform. To allow clicking for show/hide again, add this JSON to the AdvancedFormat_Init Function as HighchartsJSON:

plotOptions: {
    series: {
        events: {
            legendItemClick: function() {                
            }
        }
    }
}

Note that you can also supply JavaScript in that legendItemClick function to do fancy things like hiding all others when clicking a legend etc.

Solution

For further reference:


https://api.highcharts.com/highcharts/


You can find all the additional settings of highcharts here.

@Bas: unfortunately, in this case OutSystems chose to override the Highcharts default of enabling click/hide via the legend, so studying the Highcharts API wouldn't have helped ;).

Kilian Hekhuis wrote:

Hi Ayu,

By default, clicking is disabled by the Platform. To allow clicking for show/hide again, add this JSON to the AdvancedFormat_Init Function as HighchartsJSON:

plotOptions: {
    series: {
        events: {
            legendItemClick: function() {                
            }
        }
    }
}

Note that you can also supply JavaScript in that legendItemClick function to do fancy things like hiding all others when clicking a legend etc.

Hallo Kilian,

It works perfectly, Thanks!

You're most welcome! Happy coding :).