bizcharts-3x自定义 tooltip

Geom

  1. <Geom
  2. type='line'
  3. position='time*value'
  4. color={colors}
  5. shape='smooth'
  6. size={2}
  7. tooltip={['time*value*type', (time, value, name) => {
  8. return {
  9. title: formatDate(time),
  10. name,
  11. value: `${value}%`,
  12. }
  13. }]}
  14. />

tooltip

  1. <Tooltip
  2. useHtml
  3. htmlContent={(title, items) => {
  4. console.log('title', title, items)
  5. return `<div class="g2-tooltip" style='position:absolute;'>${title}</div>`
  6. }}
  7. />