WebChart axis text color


I have a WebChart on a dark background and I need to change both the x and y axis colors to white.

I set up a ColorGroup and used
HistoryChart.style.ForegroundColor = WhiteColorGroup
but it doesn’t work.

HistoryChart.style.BackgroundColor does work, and so does the legend and title colors, so I’m assuming I’m doing something wrong.

Please help!

thanks so much

Can you create a sample project and share with dropbox, google drive, …?
It will be easier for someone to just run that and see if something can be changed to make it work. If not, it can be used to create an Issue either for bug report or feature request.

Edit: I guess you want the ‘grid’ to be same color as the text labels? This is a screenshot from the Web Example that comes with Xojo:

Edit2: I’m having a hard time finding if ChartJS offers automatic dark mode. Maybe this will be a feature request to Xojo offer options that are not available automatic on the underlying code.

1 Like

Thanks Alberto! That was very useful!

I was able to reproduce the problem in a sample web app and find an issue which I will submit.

This problem applies to the color of both axes in a WebChart as well as the Grid color.

The problem showed when the Chart was set to mode Bar. When I changed the mode to Line, it worked fine.

thanks again for your help!

1 Like