VChart icon indicating copy to clipboard operation
VChart copied to clipboard

[Bug] area chart,设置 crosshair type 为 line,line.style.strokeOpacity = 0,显示 crosshair 的时候,面积图的 line 也会展示

Open AnningZ opened this issue 1 year ago • 0 comments

Version

1.11.9

Link to Minimal Reproduction

spec attched below

Steps to Reproduce

const spec = {
  type: 'area',
  data: {
    values: [
      {
        time: '2:00',
        value: 8
      },
      {
        time: '4:00',
        value: 9
      },
      {
        time: '6:00',
        value: 11
      },
      {
        time: '8:00',
        value: 14
      },
      {
        time: '10:00',
        value: 16
      },
      {
        time: '12:00',
        value: 17
      },
      {
        time: '14:00',
        value: 17
      },
      {
        time: '16:00',
        value: 16
      },
      {
        time: '18:00',
        value: 15
      }
    ]
  },
  xField: 'time',
  yField: 'value',
  "line": {
    "style": {
      strokeOpacity: 0
    },
  },
  "crosshair": {
    "xField": {
      "line": {
        "type": "line",
      }
    }
  },
};

const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderSync();

// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;

Current Behavior

20240810104219_rec_

Expected Behavior

面积图的 line 在 strokeOpacity = 0 的情况下不展示。

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

目前通过给 strokeOpacity 设置一个极小的数值,也可以解决

AnningZ avatar Aug 10 '24 02:08 AnningZ