Я создал диаграмму, используя chartJS, и я хочу получить конкретные данные гистограммы из гистограммы в angularJs, нажав на эту гистограмму - PullRequest
0 голосов
/ 14 июня 2019
I am trying to implement click event on the Stacked Bar chart.

Below are the values i am getting wherever i click on single bar:
Bar 1 - label = P1, value = 6 
Bar 2 - label = P2, value = 7 
Bar 3 - label = P3, value = 6 and etc...

Problem: 
So wherever I click on the 1st bar the label is P1 its because I am getting the index value as 0 for the entire bar and 1 for bar 2 and so on.

Question:
Is there any way to identify the x coordinate value? so that I can identify the click is from which stack.

 options: {
            onClick: function (evt, item) {
              console.log('legend onClick', evt);
              console.log('legd item', item);
            },
}

Ожидаемый вывод: я хочу только данные определенного бара или уровень. Есть ли способ определить значение координаты x?чтобы я мог определить, из какого стека клик.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...