infor-design / enterprise

Enterprise-grade component library for the Infor Design System
https://design.infor.com
Apache License 2.0
133 stars 81 forks source link

ColumnChart: Selected event issue in column grouped chart #8916

Open aishanyagupta opened 1 month ago

aishanyagupta commented 1 month ago

In column grouped chart while clicking on bar of the chart and printing event value. two different values are coming alternatively.

Steps to reproduce

  1. Go to Link
  2. Right click on the on the widget and scroll down to inspect and click on it. image
  3. Navigate to console tab, and click on various bars of the chart as well as the bottom legends.

Here is a screen recorded video for easy understanding. screen-capture (9).webm

The expected behavior is to get the same value every time we click on the bar.

ids-enterprise-ng: 4.95.0-dev.0

ericangeles commented 3 weeks ago

@tmcconechy, have you confirmed this one? I still don't quite understand it.

tmcconechy commented 3 weeks ago

@ericangeles yeah i dont get it, it looked like from the video that some of the data was obviously wrong in the console. Not when clicking a group you select the whole group not the bar. And i dont get the part about right clicking? But trying it i dont see any issues

Screenshot 2024-08-19 at 10 26 18 AM

@aishanyagupta can you update the steps? the data looks ok to me. maybe your looking at a wrong place in the event data?

aishanyagupta commented 3 weeks ago

Hi @tmcconechy,

This data is when we click first and a group is selected then image next time when we click we are console is showing this value image overall on multiple clicks of a single bar, this is how response is image Two different values are coming alternatively.

but, the case I am looking for is when we click on a bar in column grouped chart, I want to find which group it belongs to and also which bar in that group.

here is a screen recorded video screen-capture (11).webm

Please let me know if any further queries.

Thanks

yohannahbautista commented 1 week ago

@aishanyagupta Hello, here's my observations on the 'selected' events happening:

On selecting Component B (first)

On selecting Component B again (second)

On selecting Component B one last time (third)

From what I'm seeing. When you click the group, it selects the group and focuses on the group (hence receiving the group data when selected event is triggered). Then when you click any element in that group, it selects and focuses on that element. If you click again after that, the focused element is deselected and the group is selected again. I think this is more on a confusion on what's selected rather than the expected data?

Checking on an older version and the behavior is still the same: https://4700-enterprise.demo.design.infor.com/components/column-grouped/example-selected.html

If it's needing the group data when selecting a bar element, we could add a parent index in the data?

aishanyagupta commented 3 days ago

Hi @yohannahbautista, The requirement is when we click anywhere on chart we need to know which group it belongs to as well as which bar in that group. I need to know which bar is selected in that group.

yohannahbautista commented 2 days ago

Hi @yohannahbautista, The requirement is when we click anywhere on chart we need to know which group it belongs to as well as which bar in that group. I need to know which bar is selected in that group.

@aishanyagupta Would having the index in the data be enough? Maybe something called the childIndex?

aishanyagupta commented 2 days ago

Hi @yohannahbautista, The requirement is when we click anywhere on chart we need to know which group it belongs to as well as which bar in that group. I need to know which bar is selected in that group.

@aishanyagupta Would having the index in the data be enough? Maybe something called the childIndex?

@yohannahbautista yes, that will be enough, Thanks