Comments (24)
I'll take a look at nice ways of showing negative scales for both bar and line charts.
from chart.js.
Could, we enhance the bar charts for the horizontal look and provide it also as an option?? I would also like to know how to contribute to the library with new chart types as an option.
from chart.js.
anything new on this?
from chart.js.
In my fork (https://github.com/WimAtIHomer/Chart.js) I have made changes to support negative values
from chart.js.
Did you do a pull-request? It would be awesome to have it for everybody in the main chartjs!
from chart.js.
The changes are part of my pull-request "BarAndLine Chart added". Don't know if will ever be part of the main chartjs, never had a reply on that pull-request. The project looks kind of dead.
from chart.js.
Any progress on this? PS. Thank you WimAtIHomer, your version works great.
Edit: I had to remove ".toFixed(getDecimalPlaces(stepValue))" from the populateLabels function in order to set correct labels on -1, 0, 1, etc values.
from chart.js.
still no progress with negative numbers?
from chart.js.
Bars with negative numbers works on the alternative version available at https://github.com/FVANCOP/ChartNew.js . This version is down compatible with nnnick version.
from chart.js.
thank you very much!
from chart.js.
Haven't had a chance to put that into the new version just yet. I'll leave this open as an enhancement, if anyone wants to take a look at incorporating their changes into the Chart.Scale
class that'd be winning.
from chart.js.
I've proposed a fix, and wrapped it up as a pull request. This change works for my use case, but feel free to take it and generalize it.
from chart.js.
Hey guys, how is this going? is @ahrex 's pull request good to go? I'm looking to use a lot of these charts in production soon, and this is one of the biggies ;)
from chart.js.
Hey @tannerlinsley,
There's a bug with my proposed fix where the scale will look wonky upon resize (responsive == true). I'm testing out @3xmo's potential fix he provided at #669 (comment). I'll let you know how it goes.
EDIT: fixed.
from chart.js.
@ahrex Awesome. If you need some help, let me know.
from chart.js.
I've not tested with responsive: true, but the previous PR is a win.
from chart.js.
@tannerlinsley, @chrisfromredfin,
I've cleaned up my pull request. The tip of ahrex/Chart.js now has the alternative origin wrapped up in a method, and I've replaced all areas that were calling the old origin with this method. It works for me, but I haven't tested all cases so feel free to comment on anything unusual you see.
from chart.js.
Everything so far seems to look amazing with @ahrex 's modifications. I'd love to see this merged in asap.
from chart.js.
@ahrex - I checked out the pending pull request here, and changed some of the bar values to negative values, but this resulted in the negative bar flowing outside of the scale and canvas. Can you confirm?
from chart.js.
👍 please include #994
from chart.js.
I am moving to axis milestone as it may be related
from chart.js.
Moved my PR from #669 to #1094.
Working example at https://jsfiddle.net/ahrex/jy8nnaem/.
Thanks,
Alex
from chart.js.
@tannerlinsley: the negative values overflowing are due to the option being specific to a bar chart, I believe. You have to pass in a bar-specific object during creation in order to get it working.
from chart.js.
@borgar Huzzah! 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.
https://github.com/nnnick/Chart.js/releases/tag/v2.0-alpha
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.
from chart.js.
Related Issues (20)
- Accessibility: docs site alt text HOT 2
- Labels overlapping on X-axis when they shouldn't
- Support Legend Text Styling (To Visualize Hover)
- Building for production removes y axis ticks
- Confidence levels in Line chart
- tick backdrop painted incorrectly when align==='inner'
- Race condition when adding points too fast HOT 1
- Platform-specific requestAnimationFrame HOT 3
- curve styles only partially applied on update('none') HOT 1
- Time cartesian axis generates incorrect tick width for first and last tick
- Guidance on adding line shadows in v4
- Linear axis with step size not supports general tick options HOT 2
- Chart.js packages documentation along with actual source code, bloating node_modules HOT 1
- Funnel Chart Please HOT 2
- Doughnut chart has an active element when hovering out
- Label font style not rendering due to having some 'null' points in the array.
- Line chart type time data is being grouped incorrectly
- CDN version of the plain (esm) chart.js cannot be imported? HOT 8
- Bottom line under 0 (zero) is drawn in line chart but shouldn't if tick beginAtZero is set to 0
- "pie": Runtime errors when setting legend position to "left" or "right" HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chart.js.