Skip to content

ReferenceDot with a custom shape #469

Closed
@sglza

Description

@sglza

Describe the bug

I'm unable to render a custom ReferenceDot on a ScatterChart, as there seems to be an issue with the use of the <svg/> tag.

Reproduction

https://stackblitz.com/edit/react-pdf-charts-starter-wzl2bp?file=src%2FApp.tsx

const CustomShape = (props) => {
  const { cx, cy } = props;
  return (
    <svg x={cx - 10} y={cy - 10} width={20} height={20} fill="red" viewBox="0 0 24 24">
      <path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z" />
    </svg>
  );
}

<ReferenceDot x={500} y={500} shape={CustomShape} />

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions