Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing axis label color in LightningChart JS

The chart appears with dark background, axis numeric labels in grid positions are yellow.

How do I change axis label colors to white?

E.g. in this example https://www.arction.com/lightningchart-js-interactive-examples/#edit/lcjs_example_0001_simpleScatter

I'm trying

chart.getDefaultAxisX()
  .setInterval(0, 92 * dataFrequency)
  .setTickStyle((visibleTicks) => visibleTicks
              .setLabelFillStyle( color: ColorRGBA(255, 255, 255) })
             )

But it's giving SyntaxError: Unexpected token, expected ","

like image 336
Keira Avatar asked Feb 27 '26 07:02

Keira


1 Answers

According to the documentation it expects you to pass FillStyle, not just color. The solution for your case is as follows:

chart.getDefaultAxisX()
  .setInterval(0, 92 * dataFrequency)
  .setTickStyle( (visibleTicks) => visibleTicks
                     .setLabelFillStyle( 
                         new SolidFill( { color: ColorRGBA(255, 255, 255) } )
                     )
               )
like image 74
shallowpie Avatar answered Mar 02 '26 14:03

shallowpie



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!