How do you change the background color of a wdget from white to transparent?

Does anyone know how to change the Gauge and the Chart widget background color from white to transparent?

Gauge and Chart

Posted: September 15, 2020 at 3:18 pm
Replies: 1
Oct 2, 2020
Posted by Patrick Burma

I was able to do this by adding the following code to the pages On Start.

var chart = client.getWidget(“Gauge1”);
var config = chart.chartConfig;
config.shapes[0][‘background-color’] = “transparent”;
config.scaleR.guide.items[0] = “transparent”;
chart.chartConfig = config;

To arrive at this I looked at the widget settings in the docs:

https://internal.vantiq.com/docs/system/cbref/index.html#gauge

Then I took the sample code and added a console.log(config) to the pages On Start code area to determine what the available json keys/values are there and then did a little trial and error to figure out the items and the shapes arrays will set the bg color.

-P

Attachments:
You must be logged in to view attached files.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
© Vantiq 2024 All rights reserved  •  Vantiq Corporation’s Privacy Policy and Cookie Policy