Change PowerChart background colour depending on session theme

The background color is set by plots.0.color, etc.

Unfortunately the Perspective chart components are all third-party (mostly AM Charts) and don't know about the Perspective themes so we can't use theme variables such as --neutral-20, etc. My workaround has been to create a session custom variables for any colors I want and then create an expression binding on those. For example,

if(left({this.props.theme}, 4) = 'dark',
	'#333333',
	'#dddddd'
)

Then bind plots.0.color to that session prop.

As you can see, the only restriction is that all my dark themes have to start with 'dark'. If you want to get fancy, create a colorConfig object in the session variables and create objects within that such as an array of colors for the pens. Here's a sample.

Session chart colors