Changing axis label color in LightningChart JS

五迷三道 提交于 2020-01-11 11:26:24

问题


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 ","


回答1:


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


来源:https://stackoverflow.com/questions/58537335/changing-axis-label-color-in-lightningchart-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!