ant-design / ant-design-charts

A React Chart Library
https://ant-design-charts.antgroup.com/
MIT License
1.95k stars 364 forks source link

How to show ant design icon inside an annotation of type html? #850

Closed imaaditya-stack closed 3 years ago

imaaditya-stack commented 3 years ago

My annotation config

      {
        type: "html",
        position: { date: "2021/05/21 11:45:00 AM", score: "max" },
        html: (a: any, b: any) => {
          return `<svg width="24" height="24">
                    <circle cx="12" cy="12" r="11" fill='${"#ff1a1a"}' />
                    <text x="50%" y="50%" text-anchor="middle" fill="white" font-size="12px" font-family="Arial" dy=".3em">
                    '${(<InfoOutlined />)}'</text>
                    Sorry, your browser does not support inline SVG.
                </svg>`;
        },
        offsetX: -12,
        offsetY: -5,
      },

I want to show icon inside an annotation like this Selection_059

But my above annotation implementation is not working, it shows like this

Selection_060

How do I achieve this ?

lxfu1 commented 3 years ago

https://www.yuque.com/antv/g2plot/kdkyoc#MryMU