Javascript 如何使用lightningchart将比例更改为任意数字

Javascript 如何使用lightningchart将比例更改为任意数字,javascript,lightningchart,Javascript,Lightningchart,使用lightningchart设置要显示的比例时,默认大小为5或10个增量 是否可以将其更改为任意增量2个增量、3个增量等 请告诉我。轴会根据轴的缩放级别和每个刻度标签的可用空间自动计算增量大小。我们期待在今年夏天的下一个主要版本中改进Axis的行为 同时,可以使用customTicks手动创建此行为 /* * LightningChartJS example that showcases a simple XY line series. */ // Import LightningCha

使用lightningchart设置要显示的比例时,默认大小为5或10个增量

是否可以将其更改为任意增量2个增量、3个增量等


请告诉我。

轴会根据轴的缩放级别和每个刻度标签的可用空间自动计算增量大小。我们期待在今年夏天的下一个主要版本中改进Axis的行为

同时,可以使用customTicks手动创建此行为

/*
 * LightningChartJS example that showcases a simple XY line series.
 */
// Import LightningChartJS
const lcjs = require('@arction/lcjs')

// Extract required parts from LightningChartJS.
const {
    lightningChart,
    ColorRGBA,
    UIElementBuilders,
    emptyFill,
    emptyLine,
    emptyTick,
    SolidLine,
    SolidFill
} = lcjs
    // Create a XY Chart.
const chart = lightningChart().ChartXY()
    .setTitle('XY Chart with custom tick interval')

// Get the default X Axis and cache it
const defXAxis = chart.getDefaultAxisX()
// Set the default Axis style as emptyTick, hiding the default Ticks created
// by the AxisTickStrategy
defXAxis.setTickStyle(emptyTick)
// Iterate an arbitrary amount of ticks, creating a new customTick with interval of 2
for ( let i = 10; i <= 90; i += 2 ) {
    // Add a new custom tick to the X Axis
    defXAxis.addCustomTick(
        // Modify the textBox to hide its background and border
        UIElementBuilders.PointableTextBox.addStyler(
            (styler) => {
                styler.setBackground(
                    (bg)=> 
                        bg
                            .setFillStyle(emptyFill)
                            .setStrokeStyle(emptyLine)
            ) }
        ))
        // Set the tick position
        .setValue( i )
        // Make the Grid stroke less visible
        .setGridStrokeStyle(
            new SolidLine( {
                thickness: 1,
                fillStyle: new SolidFill( { color: ColorRGBA(200, 200, 200, 50)})
            })
        )
}