【问题标题】:How to use TickMarkType.TimeWithSeconds with the CDN version如何在 CDN 版本中使用 TickMarkType.TimeWithSeconds
【发布时间】:2021-02-05 20:46:29
【问题描述】:

我希望能够生成 x 轴形式为年-月-日时:分:秒的图表。

我在文档中看到您必须使用 tickMarkFormatter 并且您必须定义常量 TickMarkType.TimeWithSeconds 但我不明白在哪里!

我不使用 Typescript,只是在脚本标签中导入了 .js 库的 html 页面,有人可以帮我吗?

完成后,我只需要以这种方式在我的数据中添加时间吗?

lineSeries.setData([
    { time: '2020-04-11 20:10:00', value: 80.01 },
    { time: '2020-04-12 20:10:10', value: 96.63 },
    { time: '2020-04-13 20:10:20', value: 76.64 },
    { time: '2020-04-14 20:10:30', value: 81.89 },
    { time: '2020-04-15 20:10:40', value: 74.43 },
    { time: '2020-04-16 20:10:50', value: 80.01 },

]);

【问题讨论】:

    标签: javascript cdn tradingview-api lightweight-charts


    【解决方案1】:

    好的,只是需要使用时间戳而不是日期格式。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-09-28
      • 2020-10-10
      • 2020-03-11
      • 2021-12-10
      • 2016-09-02
      相关资源
      最近更新 更多