17
Views
3
Comments
Solved
[OutSystems Charts] Adding patter-fill.js Highcharts module
outsystems-charts
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

Im trying to use the pattern-fill module from highcharts to change my column charts to show a pattern instead of a solid color, but i cant find the module in the HighchartModules static entity. Is there a native way to do so or any workaround?
I want a behaviour like in this demo from the Highcharts documentation:
https://www.highcharts.com/samples/highcharts/series/pattern-fill-pie?jsfiddle


Captura de tela 2025-06-09 182353.jpg
2026-01-28 16-57-48
Mihai Melencu
Champion
Solution

Hi Nikolas, You can download the JS file for the pattern-fill feature from the Highcharts docs here:  https://www.highcharts.com/docs/chart-design-and-style/pattern-fills  ( Direct link: https://code.highcharts.com/modules/pattern-fill.js )  To use it, I imported the script and then set it as required in the screen and then set the pattern fill in the OnInitialize event of the chart using this JavaScript: 

const chartPlotOptions = {

  plotOptions: {

    area: {

      fillColor: {

        pattern: {

          // Define the hatch lines

          path: {

            d: 'M 0 0 L 6 6',     

            strokeWidth: 2,        

            stroke: '#4263EB'      

          },

          width: 8,               

          height: 8,               

          backgroundColor: '#2BC0E4' 

        }

      },

    }

  }

};


OutSystems.ChartAPI.Chart.SetProviderConfigs(

  $parameters.ChartWidgetId,

  JSON.stringify(chartPlotOptions)

); I’ve also attached a sample you can check out. Result: 

PatternSample.oml
2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

@Nickolas Barbosa please follow the approach mentioned by @Mihai Melencu, but keep two things in mind. This will be unsupported code, and for maintenance, you need to make sure that every time you update OutSystems Charts, you will be updating the script for the same version of HighCharts, since you might start having unwanted behaviours if that doesn't happen.

2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

@Nickolas Barbosa please follow the approach mentioned by @Mihai Melencu, but keep two things in mind. This will be unsupported code, and for maintenance, you need to make sure that every time you update OutSystems Charts, you will be updating the script for the same version of HighCharts, since you might start having unwanted behaviours if that doesn't happen.

2026-01-28 16-57-48
Mihai Melencu
Champion
Solution

Hi Nikolas, You can download the JS file for the pattern-fill feature from the Highcharts docs here:  https://www.highcharts.com/docs/chart-design-and-style/pattern-fills  ( Direct link: https://code.highcharts.com/modules/pattern-fill.js )  To use it, I imported the script and then set it as required in the screen and then set the pattern fill in the OnInitialize event of the chart using this JavaScript: 

const chartPlotOptions = {

  plotOptions: {

    area: {

      fillColor: {

        pattern: {

          // Define the hatch lines

          path: {

            d: 'M 0 0 L 6 6',     

            strokeWidth: 2,        

            stroke: '#4263EB'      

          },

          width: 8,               

          height: 8,               

          backgroundColor: '#2BC0E4' 

        }

      },

    }

  }

};


OutSystems.ChartAPI.Chart.SetProviderConfigs(

  $parameters.ChartWidgetId,

  JSON.stringify(chartPlotOptions)

); I’ve also attached a sample you can check out. Result: 

PatternSample.oml
2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

@Nickolas Barbosa please follow the approach mentioned by @Mihai Melencu, but keep two things in mind. This will be unsupported code, and for maintenance, you need to make sure that every time you update OutSystems Charts, you will be updating the script for the same version of HighCharts, since you might start having unwanted behaviours if that doesn't happen.

UserImage.jpg
Nickolas Barbosa

Thanks for the help!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.