amcharts5 icon indicating copy to clipboard operation
amcharts5 copied to clipboard

Grouper's `groupProperties` for am-charts v5

Open SDVII opened this issue 2 years ago • 4 comments

Question

What's the equivalent for groupProperties used by slice grouper in am-charts v4 for v5? The documentation doesn't seem to be mention it and it's undefined in the grouper's object. I've tried using adapter but without any luck. Is there someway to adjust the other's slice's properties?

Thank you for your time

Environment (if applicable)

  • amCharts: v.5.1.14
  • Edge: v.101.0.1210.47
  • React: v.16.14.0,

SDVII avatar May 20 '22 12:05 SDVII

There's currently no equivalent. We might implement it in the future.

martynasma avatar May 20 '22 13:05 martynasma

If that's the case. Is there a way to change the other's slice color? I am setting the chart's colors using something similar to:

chart.get("colors")
    .set("colors", () => ...)

which is coloring the slices correctly when not using grouping, but the grouping slice is not obeying the theme's colors

SDVII avatar May 23 '22 07:05 SDVII

Well, the "Other" slice will take the next color from colors after the last slice.

Another option would be to use an adapter:

series.slices.template.adapters.add("fill", function(color, target) {
  return target.dataItem == grouper.getPrivate("groupDataItem") ? am5.color(0x00ff00) : color;
});

https://codepen.io/team/amcharts/pen/wvyqVGx?editors=0010

martynasma avatar May 23 '22 15:05 martynasma

Thanks!

SDVII avatar May 24 '22 05:05 SDVII