How can we change spider chart background color?

Taylor :

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]

Julien :

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])

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=26232&siteId=1