3

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]

Taylor
  • 39
  • 3
  • 2
    For anyone interested you can edit the chart here: [LightningChart JS Interactive Examples - Dashboard with LegendBox](https://www.arction.com/lightningchart-js-interactive-examples/edit/lcjs-example-0500-dashboardWithLegendBox.html) – Mr. Polywhirl Feb 20 '20 at 14:56

1 Answers1

4

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])
Julien
  • 2,256
  • 3
  • 26
  • 31