Skip to content

Combining facets with annotations #57

Open
@bergatronic

Description

Hi all,

I am creating an apexchart split into facets and I would like to add annotations to one specific sub-graph (facet).

However, adding a point annotation I see that it is added to all graphs.

Is there a way to add an annotation to a specific facet of the graph?

Below is a small reproducible example showing the behaviour.

Many thanks in advance

library(apexcharter)
apex(iris, aes(x = Sepal.Length, y = Sepal.Width), type = "scatter" ) %>% 
  ax_facet_wrap(facets = vars(Species)) %>% 
  ax_annotations(points = list(list(
    x = 6,
    y = 3,
    marker = list(
      size = 2,
      fillColor = "red",
      strokeColor = "red",
      radius = 1
    ),
    label = list(
      text = "Test",
      offsetY = 0,
      borderColor = "#FF4560",
      style = list(
        color = "#fff",
        background = "#FF4560"
      )
    )
  )))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions