- Notifications
- Fork 11.9k
-
Star 63.6k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reverse Scale? #129
Reverse Scale? #129
Comments
nnnick
commented
Jun 5, 2013
Not right now. I'm currently collating features for the next major library release. If you have some ideas on how an API for this feature could work let me know. |
thetaylor82
commented
Feb 10, 2014
I need this urgently. Is this project dead? |
djn72
commented
Aug 2, 2014
This would be really useful, I have a simlar case where I want to display a graph of league positions over several weeks and the ability to "invert the scale" would be very useful. Wondering if anyone is looking at adding an option to implement this? I have hacked my data to achieve the results I want, but it's not pretty... (1) invert my data sources by multiplying all data points by -1 (2) override the data labels with tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= (value * -1 ) %>" (3) override the scale labels with scaleLabel: "<%=(value * -1)%>" Someone else might find this workaround useful in the meantime..... |
reinvanleirsberghe
commented
Nov 26, 2014
+1 |
ympbyc
commented
Dec 11, 2014
Passing a negative value as chart.Line({......}, {
scaleOverride: true,
scaleSteps: 19,
scaleStepWidth: -1,
scaleStartValue: 20
}); |
derekperkins
commented
Jun 4, 2015
@praxeum Try @ympbyc 's solution in conjunction with the easier config of 2.0. The first alpha of Chart.js 2.0 has landed and should fix this issue. Check out the release and try it out! We've got a lot of momentum right now, so please help us test so we can launch 2.0 Gold by the end of the month. I'm closing this issue for now, but if you have implementation questions or find bugs, please create a jsfiddle and post the link here and we'll reopen this issue and get it fixed. |
rclations
commented
Jun 15, 2015
I'm sorry if I'm totally missing something here, but |
etimberg
commented
Jun 15, 2015
@rclations I believe it got renamed. In your config, you could do something like the following config = {
scales: {
yAxes: [{
override: {
start: 10,
steps: 10,
stepWidth: -1
}
}]
}
} This is the code that uses it. |
rclations
commented
Jun 15, 2015
thanks for the quick reply! I dug around some more and found that it could be done like this in a kind of hacky way -
The Regardless, the override object would only let me really customize |
etimberg
commented
Jun 15, 2015
I'll look into the bugs tonight. It might just be easier to add a reverse option to the scale. Thanks for trying it out! |
rclations
commented
Jun 15, 2015
you bet - having a reverse option on the scale would be fantastic |
rclations
commented
Jul 9, 2015
any news on this? Could we reopen this ticket until this gets resolved? |
etimberg
commented
Jul 10, 2015
@rclations I added a reverse option to the linear scale config in 76d2a78 var options = {
scales: {
yAxes: [
{
reverse: true, // will reverse the scale
}
]
}
}; |
nightwolfy
commented
Mar 17, 2017
To draw the y axes from top to down try this. This works for me
|
abddu1
commented
Dec 4, 2017
Can the xAxis direction be reversed? We need it for RTL languages, to show the chart right to left, is this possible any other way? |
juniorcintra
commented
May 8, 2019
Any help? I need this too! |
kurkle
commented
May 8, 2019
Same var options = {
scales: {
xAxes: [{
ticks: {
reverse: true, // will reverse the scale
}
}]
}
}; |
juniorcintra
commented
May 8, 2019
I resolved this, but not on the chart.js configuration, but directly on javascript, before sent the arrays to the chart.js, using .reverse() function! :) |
DevidCIC
commented
Jun 14, 2019
•
edited
edited
This does not work for me, I have the 2.8.0 chart.js version. Anyone else with the same problem ? |
Trying to make a graph where the scale goes from 1-20 from top top bottom (for a chart over league positions), is that possible?
The text was updated successfully, but these errors were encountered: