Giter Club home page Giter Club logo

Comments (7)

akileos avatar akileos commented on May 21, 2024

Sample graph :

var data = [ { x: 0, y: -40 }, { x: 1, y: 3 }, { x: 2, y: -17 }, { x: 3, y: -42 } ];

var graph = new Rickshaw.Graph( {
element: document.querySelector("#chart"),
width: 580,
height: 250,
series: [ {
color: 'steelblue',
data: data
} ]
} );

graph.render();

from rickshaw.

andrew avatar andrew commented on May 21, 2024

The minimum graph value is hardcoded to 0 in all of the renders, for instance: https://github.com/shutterstock/rickshaw/blob/master/src/js/Rickshaw.Graph.Renderer.Line.js#L35

I've fixed it in my fork here: https://github.com/andrew/rickshaw/commit/7dc125e79326d94bdbf44d5337c78050757dd9c5

from rickshaw.

PlasticLizard avatar PlasticLizard commented on May 21, 2024

Any chance this change can be merged in the main project? We have a few data sets with negative values, would be very nice to have ...

from rickshaw.

andrew avatar andrew commented on May 21, 2024

I'll send a pull request

from rickshaw.

PlasticLizard avatar PlasticLizard commented on May 21, 2024

Thank you, much appreciated.

from rickshaw.

kvisle avatar kvisle commented on May 21, 2024

I've implemented a fix, where you can set a min-property on your graph. Being any number you wish, 'auto' (picks the lowest value in your current dataset), or just not define it (will fall back to the current default; 0).

https://github.com/kvisle/rickshaw/commit/a834029022a2177deb3c471b7b8a8b8b575d536d

Pull request sent, should apply to current HEAD.

from rickshaw.

dchester avatar dchester commented on May 21, 2024

This is merged in with 6a75eae

If you specify min: 'auto', in the Rickshaw.Graph constructor, you should be able to graph negative values.

from rickshaw.

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.