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

Draw labels on top of lines. Fixes #94. #161

Closed
wants to merge 3 commits into from
Closed

Conversation

krusynth
Copy link

I've split out the label from the line drawing, and added a second loop for this phase of drawing.

element.transition(easingDecimal).draw();
});
elements.forEach(function(element) {
element.configure();
Copy link
Collaborator

@benmccann benmccann May 13, 2019

Choose a reason for hiding this comment

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

do we need to call configure a second time? same with transition

Copy link
Author

Choose a reason for hiding this comment

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

🤔 Good question! I don't know?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok. Can you test if it works without the duplicate calls here? Let's remove if possible

Copy link
Author

Choose a reason for hiding this comment

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

Confirmed, draw() doesn't mutate the state of model as used in configure. Updated in 44a5432

@benmccann
Copy link
Collaborator

Chart.js 2.9.0 will have a concept of z-index: chartjs/Chart.js#6262. It would be nice to make this utilize the same concept

@krusynth
Copy link
Author

Given the way callbacks are currently being handled, I'm not sure that refactoring the entire draw loop is in scope for this issue - you'd have to delegate all drawing back to the chart controller.

@benmccann
Copy link
Collaborator

@kurkle you might be interested in this one given your work in the main repo

@krusynth
Copy link
Author

Hold off on this please. I've just noticed a side-effect where axis values aren't being redrawn when datasets are toggle on or off.

@krusynth
Copy link
Author

Ok, phew, fixed that.

@kurkle
Copy link
Member

kurkle commented May 14, 2019

This is a step towards layers, looks quite good. Should work without the 2nd transition.

@firebird631
Copy link

Hi, I except the same enhancement. Is it still in progress ?

element.transition(easingDecimal).draw();
});
elements.forEach(function(element) {
element.transition(easingDecimal).drawLabel();
Copy link
Member

Choose a reason for hiding this comment

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

Should not need to transition again?

@kurkle kurkle changed the base branch from master to v2 December 18, 2020 19:32
@kurkle kurkle closed this Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants