如何在 LightningchartV2.2.1 中使用 Datetime Axisx?

问题描述

我注意到 Custom DateTime in X axis in Lightningchart JS 中的答案,但它在 LightningchartV2.2.1 中报告错误“AxisTickStrategies.DateTime is not a function”。 此外,由于 AxisTickStrategies.DateTime 不是函数,我如何使用 DateTime 轴显示系列的完整日期轴 x 标签

解决方法

请查看官方的 LCJS Interactive Examples,并搜索“datetime”

例如, https://www.arction.com/lightningchart-js-interactive-examples/examples/lcjs-example-0020-dateTimeAxis.html

这是最低要求的代码 - 请参阅示例以进行扩展修改。

chart.getDefaultAxisX()
    .setTickStrategy(
        // Use DateTime TickStrategy for this Axis
        AxisTickStrategies.DateTime,)