VChart icon indicating copy to clipboard operation
VChart copied to clipboard

[Feature] `dimensionHover` and `dimensionClick` can follow tooltip

Open xile611 opened this issue 1 year ago • 1 comments

What problem does this feature solve?

active point should follow tooltip events

What does the proposed API look like?

{
  dimensionHover?: {
    trigger?: 'hover' | 'tooltip'
  }
}

xile611 avatar May 31 '24 02:05 xile611

 {
  type: 'line',
  data: {
    values: [
      {
        x: '1st',
        y: 0.012
      },
      {
        x: '2nd',
        y: -0.01
      },
      {
        x: '3rd',
        y: 0.005
      },
      {
        x: '4th',
        y: 0.007
      },
      {
        x: '5th',
        y: 0.01
      },
      {
        x: '6th',
        y: 0.017
      },
      {
        x: '7th',
        y: 0.022
      },
      {
        x: '8th (prediction)',
        y: 0.033,
        latest: true
      }
    ]
  },
  xField: 'x',
  yField: 'y',
  tooltip: {
    trigger: ['hover'],
    triggerOff: 'none'
  },
  point: {
    style: {
      visible: false,
    },
    state: {
      dimension_hover: {
        visible: true,
        size: 10
      }
    }
  }
}

Gavinchen92 avatar Jun 04 '24 07:06 Gavinchen92