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

Unable to apply certain styles via annotation cssClass #488

Open
jsmartt opened this issue May 2, 2023 · 1 comment
Open

Unable to apply certain styles via annotation cssClass #488

jsmartt opened this issue May 2, 2023 · 1 comment

Comments

@jsmartt
Copy link

jsmartt commented May 2, 2023

I'm trying to apply a class to my x-axis annotation label which contains cursor: pointer. I can successfully set the label.style.cssClass property like so:

annotations: {
  xaxis: [
    {
      x: new Date("11/17/2017").getTime(),
      label: {
        style: {
          cssClass: "pointer" // Not working as intended
        },
        text: "Styled Anno"
      }
    }
  ]
}

I see that the pointer class gets applied to a <text> tag, but only certain css styles appear to be working. font-size works, but cursor: pointer does not. I want to indicate to my users that the annotation is clickable (only for certain annotations that are clickable). Is there way to do this?

See https://codepen.io/jsmartt/pen/vYVewjB

Thanks!


Note that I was able to inspect the DOM elements and apply the class to the <rect> tag that precedes the <text> tag, and that worked.

<!-- Applying the class to this <rect> tag works: -->
<rect id="SvgjsRect1145" width="22" height="95.40625" x="66.71749877929688" y="18.34375" rx="2" ry="2" opacity="1" stroke="#775dd0" stroke-width="1" stroke-dasharray="0" fill="#775DD0"></rect>

<!-- ...but the class is applied to the <text> tag, which doesn't appear to support certain styling: -->
<text id="SvgjsText1140" class="apexcharts-text apexcharts-xaxis-annotation-label pointer " font-family="Helvetica, Arial, sans-serif" x="77.7175" y="72.046875" text-anchor="middle" dominant-baseline="auto" font-size="11px" font-weight="400" fill="#ffffff" rel="0" style="font-family: Helvetica, Arial, sans-serif;" transform="rotate(-90 77.71749877929688 67.046875)">Styled Anno</text>
Copy link

github-actions bot commented Aug 2, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

1 participant