apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.58k stars 19.62k forks source link

[Bug] Axis type as value is workable in the heatmap-large example but has to be category in my app #17164

Closed ZhengRui closed 2 years ago

ZhengRui commented 2 years ago

Version

5.3.2

Link to Minimal Reproduction

No response

Steps to Reproduce


option = {
  tooltip: {},
  xAxis: [{
    type: 'value',
  }],
  yAxis: [{
    type: 'value',
  }],
  visualMap: [{
    min: 0,
    max: 1,
  }],
  series: [
    {
      name: 'Gaussian',
      type: 'heatmap',
      data: Array.from({length: 10}, (_, i)=> Array.from({length: 10}, (_, j) => [i+.5, j+.5, (i+j)/20])).flat(),
    }
  ]
};

Current Behavior

In the heatmap-large example , i can change xAxis and yAxis type to be either category or value, but in my typescript App, it gives error (using the same minimum option as above for both the example and my app): "Heatmap on cartesian must have two category axes". However, i hope the axis to be value type so I can set min and max.

Expected Behavior

Axis type as value should also work in my app as in the heatmap-large example

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

I am curious why with same version, same option, it works in the Heatmap-large example but not working in my app. I am wondering if it is because I am importing echarts library and then use it in my react project, while the example page is using compiled minified echarts through Githubissues.

  • Githubissues is a development platform for aggregating issues.