Giter VIP home page Giter VIP logo

Comments (24)

nnnick avatar nnnick commented on May 5, 2024

I'll take a look at nice ways of showing negative scales for both bar and line charts.

from chart.js.

kkush33 avatar kkush33 commented on May 5, 2024

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.

sebfischer83 avatar sebfischer83 commented on May 5, 2024

anything new on this?

from chart.js.

WimAtIHomer avatar WimAtIHomer commented on May 5, 2024

In my fork (https://github.com/WimAtIHomer/Chart.js) I have made changes to support negative values

from chart.js.

Xaviju avatar Xaviju commented on May 5, 2024

Did you do a pull-request? It would be awesome to have it for everybody in the main chartjs!

from chart.js.

WimAtIHomer avatar WimAtIHomer commented on May 5, 2024

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.

nicotroia avatar nicotroia commented on May 5, 2024

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.

kurtseebauer avatar kurtseebauer commented on May 5, 2024

still no progress with negative numbers?

from chart.js.

FVANCOP avatar FVANCOP commented on May 5, 2024

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.

kurtseebauer avatar kurtseebauer commented on May 5, 2024

thank you very much!

from chart.js.

nnnick avatar nnnick commented on May 5, 2024

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.

ahrex avatar ahrex commented on May 5, 2024

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.

tannerlinsley avatar tannerlinsley commented on May 5, 2024

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.

ahrex avatar ahrex commented on May 5, 2024

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.

tannerlinsley avatar tannerlinsley commented on May 5, 2024

@ahrex Awesome. If you need some help, let me know.

from chart.js.

chrisfromredfin avatar chrisfromredfin commented on May 5, 2024

I've not tested with responsive: true, but the previous PR is a win.

from chart.js.

ahrex avatar ahrex commented on May 5, 2024

@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.

tannerlinsley avatar tannerlinsley commented on May 5, 2024

Everything so far seems to look amazing with @ahrex 's modifications. I'd love to see this merged in asap.

from chart.js.

tannerlinsley avatar tannerlinsley commented on May 5, 2024

@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.

m1ga avatar m1ga commented on May 5, 2024

👍 please include #994

from chart.js.

fulldecent avatar fulldecent commented on May 5, 2024

I am moving to axis milestone as it may be related

from chart.js.

ahrex avatar ahrex commented on May 5, 2024

Moved my PR from #669 to #1094.

Working example at https://jsfiddle.net/ahrex/jy8nnaem/.

Thanks,
Alex

from chart.js.

ahrex avatar ahrex commented on May 5, 2024

@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.

derekperkins avatar derekperkins commented on May 5, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.