Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to show custom icons for scatter plot data points? #3603

Closed
imaaditya-stack opened this issue Sep 2, 2021 · 1 comment
Closed

How to show custom icons for scatter plot data points? #3603

imaaditya-stack opened this issue Sep 2, 2021 · 1 comment

Comments

@imaaditya-stack
Copy link

  • G2 Version:
  • Platform:
  • Mini Showcase(like screenshots):
  • CodePen Link:

Below is an example of my scatter plot
image

I want to show custom ant design icons for each data point based on a data point in my data like below

image

My chart config

  var config = {
    data: data,
    xField: "date",
    yField: "score",
    xAxis: {
      tickCount: 4,
      label: {
        formatter: function formatter(v: any) {
          return moment(v, "YYYY-MM-DD hh:mm A").format("hh:mm A");
        },
        style: {
          fill: "#6E759F",
        },
      },
    },
    yAxis: {
      label: {
        style: {
          fill: "#9AA5B5",
        },
      },
    },
    meta: {
      score: {
        min: 0,
        max: 100,
        tickInterval: 25,
      },
    },
  };

My data structure

  {
    "id": ,
    "date": "2021/05/20 12:03:00 PM",
    "Application": "",
    "Activity": "",
    "score": 50
  }

The icon should be based on Activity in the data structure above.
For eg -> If Activity is Login then login icon will show for the data point.

@hustcc
Copy link
Member

hustcc commented Aug 22, 2023

See this demo in G2 5.0: https://g2.antv.antgroup.com/examples/general/image/#logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants