74
Views
5
Comments
CSS for Highcharts
Question

I cant seem to figure out what CSS needs to be entered to change the legend text to white.  I have read about everything I can find just cant seem to put 2 and 2 together.  Can someone lead me with an example of the actual css needed entered either in the AdvancedFormat HigchartsJSON or in the CSS Style sheet?  This is in a tablet app.

2024-08-22 11-39-17
Pedro Sousa

Hello,

You can choose one of the following two options

1) Using CSS

.highcharts-legend-item text {    fill: white !important;}


2) Using javascript

On Ready event of your screen use a javascript node and apply the following script

const chartPlotOptions = {           'legend': {            'itemStyle': {                'color': '#fff'            },            'itemHoverStyle': {                'color': '#fff'            }        }  };  OutSystems.ChartAPI.Chart.SetProviderConfigs($parameters.ChartWidgetId, JSON.stringify(chartPlotOptions));


Note: $parameters.ChartWidgetId is an input parameter of the script and should be the Id of the chart that you define in your screen.

Should look something like this:


Regards,

Pedro.



2023-08-28 07-00-10
Paulo Torres
Champion

You have to check the documentation of Highcharts, for sure they have options for what you want.

Examples:

UserImage.jpg
Craig Rodrigues

Dear Ryan , 
Please find attached , 
Further more please refer to documentation about high chart js. 

https://api.highcharts.com/highcharts/legend.itemStyle

Outsytem's link.
https://success.outsystems.com/documentation/11/reference/outsystems_apis/charts_api/advanced_charts_customization_with_json/


If you still have issues initializing any advance format then please use the suitable action from here 
i.e AdvancedFormat_Init 

https://success.outsystems.com/documentation/11/reference/outsystems_apis/charts_api/?_gl=1*63i5ha*_ga*MjA5NzQ2MjE4OC4xNjg3NDk1Mzgx*_ga_ZD4DTMHWR2*MTcxMTk0NTAzNi4zLjEuMTcxMTk0OTI4MC41MS4wLjA.
In my oml you will find an easy way to change the legend color to green


Kind regards,
Craig

ChartLegend_Green.oml
UserImage.jpg
Ryan Flaherty

Got it. Thanks for the help.  I was missing the !important and that was making it all stay at the black default lettering... 

.highcharts-legend-item text {        fill: white !important;}

2024-08-22 11-39-17
Pedro Sousa

Hi @Ryan Flaherty ,

I'm glad it helped. Please mark as a solution so it can help others.


Regards,

Pedro.

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