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

Fix for #3443 - bar chart click function broken in usage dashboard #3444

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

gjacob24
Copy link
Contributor

@gjacob24 gjacob24 commented Jul 31, 2024

Fixes #3443

Changes proposed in this PR:

  • getElementAtEvent replaced by getElementsAtEventForMode

@@ -42,11 +42,12 @@ $(() => {
const usersData = JSON.parse($('#users_joined').val());
if (isObject(usersData)) {
const chart = createChart('#yearly_users', usersData, '', (event) => {
const segment = chart.getElementAtEvent(event)[0];
const points = chart.getElementsAtEventForMode(event, 'nearest', { intersect: true }, true);
const segment = points[0];
if (!isUndefined(segment)) {
const target = $('#users_click_target').val();
/* eslint-disable no-underscore-dangle, no-restricted-globals */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bar chart click function is now working. :) Given these code changes, I think no-underscore-dangle, can now be removed from eslint-disable throughout the file (can be double-checked by executing yarn run eslint app/javascript/src/usage/index.js).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Aaron! I didn't know that. I'll create another commit to remove it now.

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

Successfully merging this pull request may close these issues.

3 participants