VisActor / VChart

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

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

Open xile611 opened 1 month ago

xile611 commented 1 month ago

What problem does this feature solve?

active point should follow tooltip events

What does the proposed API look like?

{
  dimensionHover?: {
    trigger?: 'hover' | 'tooltip'
  }
}
Gavinchen92 commented 4 weeks ago
 {
  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
      }
    }
  }
}