VisActor / VChart

VChart, more than just a cross-platform charting library, but also an expressive data storyteller.
https://www.visactor.io/vchart
MIT License
769 stars 44 forks source link

[Bug] Crosshair doesn't always show in histogram charts #2826

Open Crayon-ShinChan opened 1 week ago

Crayon-ShinChan commented 1 week ago

Version

1.11.3

Link to Minimal Reproduction

use demo web page

Steps to Reproduce

const spec = {
   data: [
    {
    id: "num",
    values: [
        {
            "start": 491,
            "end": 500,
            "value": 8855
        },
        {
            "start": 481,
            "end": 490,
            "value": 12120
        },
        {
            "start": 471,
            "end": 480,
            "value": 16805
        },
        {
            "start": 461,
            "end": 470,
            "value": 13828
        },
        {
            "start": 451,
            "end": 460,
            "value": 11745
        },
        {
            "start": 441,
            "end": 450,
            "value": 11022
        },
        {
            "start": 431,
            "end": 440,
            "value": 11023
        }
      ],
    },
  ],
  type: 'histogram',
  xField: 'start',
  x2Field: 'end',
  yField: 'value',
};
const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderSync();

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

Showed at 461

CleanShot 2024-06-18 at 03 02 07@2x

Didn't show otherwise

CleanShot 2024-06-18 at 03 02 00@2x

Current Behavior

Not always show crosshair

Expected Behavior

Always show crosshair

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response