Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we change spider chart background color?

Refer this image to see what i am looking at:

[1]

With this code :

const colors = [ColorRGBA(0, 255, 125, 0), ColorRGBA(255, 125, 0, 0)]
const fillStyles = colors.map((color) => new SolidFill({ color: color.setA(150) }))

const chart = db.createSpiderChart({
  columnIndex: 1,
  rowIndex: 0,
  columnSpan: 1,
  rowSpan: 2
})
  .setTitle('Spider chart')
  .setBackgroundFillStyle(fillStyles[0])

I am getting this result :

[2]

like image 645
Taylor Avatar asked Feb 02 '26 02:02

Taylor


1 Answers

You can change the background color of the chart by using the method setChartBackgroundFillStyle with the wanted FillStyle

For example:

const colors = [ColorRGBA(0, 255, 125, 0), ColorRGBA(255, 125, 0, 0)]
const fillStyles = colors.map((color) => new SolidFill({ color: color.setA(150) }))

const chart = db.createSpiderChart({
  columnIndex: 1,
  rowIndex: 0,
  columnSpan: 1,
  rowSpan: 2
})
  .setTitle('Spider chart')
  .setBackgroundFillStyle(fillStyles[0])
  .setChartBackgroundFillStyle(fillStyles[1])
like image 130
Julien Avatar answered Feb 04 '26 14:02

Julien



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!