-
Notifications
You must be signed in to change notification settings - Fork 12k
Added ability to draw a point as an inverted triangle. #5087
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
Conversation
Added ability to draw a point as an inverted triangle as it is useful for showing progress along a bar, line, or scale.
etimberg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. Thanks for updating the documentation. I think it would be worthwhile to add a test for this to https://github.com/chartjs/Chart.js/blob/master/test/specs/element.point.tests.js
|
At this point, it would be much better to expose a new option (maybe |
|
I'll add some tests. Question, I'm a newbie to using GitHub. Is there a way to add the tests and update this pull request or do you just submit an entirely new one? I just want to be sure that I make the change properly. |
|
@simonbrunel I completely agree that would be a great feature. However, that is a huge breaking change for backwards compatibility. Perhaps in a major release chartjs can support both methods for a time: "Legacy Names" and "Name and Rotation" |
Added a unit test to test out that having a point with style "triangleInv" draws and inverted triangle.
|
To update that PR, simply push new commits to your "master" branch. There is no breaking change, we still use pattern names and add support for rotation (which will be handled by a new option). We deprecate *Rot patterns (basically, remove them for the docs). There should be only one additional canvas rotation and since the default for this new option will be 0, old code still work as expected. |
|
@simonbrunel Thanks a bunch! It appears that worked nicely! I wanted to make sure I didn't disrupt things if I did it incorrectly. I submitted the unit test. The code climate checks wants me to refactor the beginning portion of the calculation but I'm thinking I should just not do that as it would probably add more complication for not much benefit. Do you agree? |
|
What I mean is that I would not add this extra string ( (though I agree to ignore CodeClimate report :) ) |
|
@cholt0425 do you plan to update this PR in the way that Simon suggested? I'm wondering if we should leave this open or close it... |
|
@cholt0425 I would really love to see this feature and would love to help review any PR ad get it merged. I'm going to close this PR since it's been inactive for awhile, but please consider reopening or submitting a new PR to support the |
Added ability to draw a point as an inverted triangle as it is useful
for showing progress along a bar, line, or scale.