apexcharts / apexcharts.js

📊 Interactive JavaScript Charts built on SVG
https://apexcharts.com
MIT License
14.36k stars 1.3k forks source link

Donut chart - hovering over legend item should not change opacity of focused data percentage label #3687

Closed patryk-zielinski93 closed 5 months ago

patryk-zielinski93 commented 1 year ago

Description

Hovering over legend item should not change opacity of focused data percentage label

Steps to Reproduce

  1. Create basic donut chart.
  2. Hover over legend item

Expected Behavior

When hovering over legend item all percentage labels are greyed out but focused element's percentage label stays visible.

Actual Behavior

All percentage labels are greyed out and almost invisible.

Screenshots

image

Reproduction Link

https://codepen.io/patryk-zielinski93/pen/vYzJvJm

JakubRejman commented 8 months ago

I'm also strugling with this issue. On bar charts everything is ok.

After comparising bar chart with donut chart I've notice that library for bars is generating data labels as:

<g id="SvgjsG10958" class="apexcharts-bar-series apexcharts-plot-series">
    <g id="SvgjsG10959" class="apexcharts-series" seriesName="seriesxx1" rel="1" data:realIndex="0">...</g>
    <g id="SvgjsG11106" class="apexcharts-series" seriesName="seriesxx2" rel="2" data:realIndex="1">...</g>
    <g id="SvgjsG11253" class="apexcharts-series" seriesName="seriesxx3" rel="3" data:realIndex="2">...</g>
    <g id="SvgjsG10960" class="apexcharts-datalabels" data:realIndex="0">...</g>
    <g id="SvgjsG11107" class="apexcharts-datalabels" data:realIndex="1">...</g>
    <g id="SvgjsG11254" class="apexcharts-datalabels" data:realIndex="2">...</g>
</g>

and for donut charts labels are generated as:

<g id="SvgjsG13354" class="apexcharts-slices">
    <g id="SvgjsG13355" class="apexcharts-series apexcharts-pie-series" seriesName="seriesxx1" rel="1" data:realIndex="0">...</g>
    <g id="SvgjsG13368" class="apexcharts-series apexcharts-pie-series" seriesName="seriesxx2" rel="2" data:realIndex="1">...</g>
    <g id="SvgjsG13381" class="apexcharts-series apexcharts-pie-series" seriesName="seriesxx3" rel="3" data:realIndex="2">...</g>
    <g id="SvgjsG13394" class="apexcharts-series apexcharts-pie-series" seriesName="seriesxx4" rel="4" data:realIndex="3">...</g>
    <g id="SvgjsG13407" class="apexcharts-series apexcharts-pie-series" seriesName="seriesxx5" rel="5" data:realIndex="4">...</g>
    <g id="SvgjsG13357" class="apexcharts-datalabels">...</g>
    <g id="SvgjsG13370" class="apexcharts-datalabels">...</g>
    <g id="SvgjsG13383" class="apexcharts-datalabels">...</g>
    <g id="SvgjsG13396" class="apexcharts-datalabels">...</g>
    <g id="SvgjsG13409" class="apexcharts-datalabels">...</g>
</g>

There is no data:realIndex attribute on <g class="apexcharts-datalabels">.