Home > other >  individual size and color in 3d scatter lighningchart
individual size and color in 3d scatter lighningchart

Time:07-28

Good morning,

I am creating a 3dscatter lighningchart graph and I want to have individual colors in a 3d scatter Lightningchart series/ #lightningchart. I have individualPointSizeEnabled set to true as wel:

my series:

const pointSeries3D_yclass = chart3D.addPointSeries({ individualPointSizeEnabled: true })
    .setPointStyle(new PointStyle3D.Triangulated({
    fillStyle: new SolidFill({ color: ColorRGBA(245, 66, 209, 100) }),
    size: 3,
    shape: 'sphere'
    }))
    .setName('1 januari')

my series data:

pointSeries3D_yclass.add([
{ x: 5.9738, y: -7.79972678, z: 347.9487, size: 15, value: 1902, color: ColorRGBA(0, 255,0) },
{ x: 5.1842, y: -7.69972678, z: 301.9554},
{ x: 4.0684, y: -7.19972678, z: 236.965},
{ x: 6.5575, y: 4.20027322, z: 381.9437, size: 20, value: 2022, color: ColorRGBA(0,255,0 )}
])

Sizes do work but the colors don't, where and how can I enable individual colors / fill color?

CodePudding user response:

See https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/interfaces/pointseriesoptions3d.html#individualpointcolorenabled

1: individualPointColorEnabled must be enabled when the series is created.

 // Example, enable PointSeries3D data `color` property.

 const pointSeries3D = chart3D.addPointSeries({
     individualPointColorEnabled: true
 })

2: individualPointColorEnabled must be enabled in order to style PointSeries3D with IndividualPointFill. See PointSeries3D.setPointStyle for more detailed information.

So in your code snippet, change fillStyle to new IndividualPointFill()

  • Related