在lightningChartJS 5.2.0中使用HeatmapGridSeries的对数轴时出错

问题描述 投票:0回答:1

我正在使用 lightingChartJS 在仪表板对象中创建热图。我的要求是有一个对数x轴,而正常的x轴不应该是可见的。此设置在 4.2.1 版本中完美运行,但更新到 5.2.0 版本后,它会抛出错误并且不显示热图。

注意:刚刚检查过,它也不适用于没有仪表板的常规 ChartXY 初始化。

这是我正在使用的 React 代码片段:

import { useEffect } from "react";
import { lightningChart, Axis, ChartXY, emptyLine } from "@arction/lcjs";

function App() {
  useEffect(() => {
    const lc = lightningChart({license: "my-license"});
 const dashboard = lc.Dashboard({
    numberOfColumns: 1,
    numberOfRows: 1,
    container: "lc"
  });
    const chart = dashboard.createChartXY({   columnIndex: 0,
      rowIndex: 0 });
    chart.getDefaultAxisX().setVisible(false);
    const logXAxis = chart
      .addAxisX({
        type: "logarithmic",
        base: 10
      })
      .setInterval({
        start: 3,
        end: 500
      });

    const heatmapSeries = chart.addHeatmapGridSeries({
      columns: 901,
      rows: 2500,
      dataOrder: "rows",
      start: { x: 0, y: 0 },
      end: { x: 25, y: 25 }
    })
    .setWireframeStyle(emptyLine)
    .setIntensityInterpolation("bilinear");

    return () => {
      chart.dispose();
    };
  }, []);

  return <div id="lc" style={{ width: "500px", height: "500px" }}></div>;
}

export default App;

在4.2.1版本中,热图显示正确,如以下屏幕截图所示: enter image description here

更新到5.2.0版本后,遇到以下错误并且图表不渲染:

Uncaught Error: HeatmapGridSeries can only be attached to a pair of Linear Axes.

这是错误的屏幕截图: enter image description here

还有其他人遇到过这个问题吗?在最新版本中是否有解决方法可以使用对数轴和热图,或者这是一个错误?

javascript lightningchart
1个回答
0
投票

热图系列不支持对数轴。即使在以前的版本中,它们也不会崩溃,但行为不正确,如果有问题的热图有任何数据,这将是可见的。

© www.soinside.com 2019 - 2024. All rights reserved.