toxicirritant
Posts: 1
Joined: Mon Jun 01, 2015 4:19 am

Targetting specific CSS classes

Hi there,

Would anyone know if it is possible to target specific CSS classes within the custom code input window of the chart editor?

I'm specifically trying to target the max-width attribute within the div id 'container'. However the ability to 'tweak' any of the existing classes would be incredibly useful from a visual design standpoint.

Look forward to your replies or any snippets of code you may wish to share.

Thanks in advance :)
OysteinMoseng
Posts: 52
Joined: Mon May 19, 2014 8:29 am

Re: Targetting specific CSS classes

Apologies for the late reply, we've been experiencing issues with the notification system for the Cloud forum.

You can set CSS options using standard Javascript in the custom code field, though that is a bit cumbersome. A cleaner solution is usually to set the "style" options for the chart elements. The "chart.style" option (in the advanced tab), for example, will allow you to set CSS for the chart container div, including max-width.
Øystein Moseng
Head of Accessibility / Core Developer
Highcharts Team

Return to “Highcharts Cloud”