antvis / G2Plot

:dango: An interactive and responsive charting library based on G2.
https://g2plot.antv.antgroup.com
MIT License
2.55k stars 605 forks source link

🐛 [BUG] 直方图无法添加表注 annotations #3716

Open JLoveI opened 9 months ago

JLoveI commented 9 months ago

🐛 Bug description [Please make everyone to understand it]

Please provide a link by forking these links G2Plot or GitHub repo, a minimal reproduction.

📷 Step to reproduce

🏞 Expected result

🚑 Any additional [like screenshots]

JLoveI commented 9 months ago
 const histogramPlot = new Histogram('container', {
      data,
      binField: 'value',
      binWidth: 2,
      annotations: [
          {
            type: 'line',
            start: [12, 0],
            end: [12, 12],
          },
      ],
    });

不生效, g2可以

Gaqier commented 4 months ago

不用配置,用通用API里的 addAnnotations 可以 plot.addAnnotations(annotations: Annotation[], view?: View) => void;