Comments (7)
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.
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.
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.
I'll send a pull request
from rickshaw.
Thank you, much appreciated.
from rickshaw.
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.
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)
- Use travis to exclude unwanted files from pull requests
- Can Rickshaw.Series.fill help me fill missing data in series?
- Time format HOT 1
- Using Rickshaw.Fixtures.formatBase1024KMGTP seems to cause Y axis to go weird HOT 4
- Hover Details flickers on left y axis on hover in Firefox HOT 3
- Question regarding minification HOT 2
- Time axis wrong label for ticks before 1900 when showing decades
- ReactJS support for Rickshaw Library HOT 1
- Gettings vis.selectAll is not a function when created from within Vue HOT 5
- Add middle-ticks between year and decade
- how to start this project??? HOT 1
- howt to custom dragZoom ?
- x axis not rendering all specified tick marks
- enhancement: Feature request
- Change label dynamically
- Broken Web Link HOT 1
- For same values of y-axis graph line moves up and down
- Change Y-axis font size
- Rickshaw in React renders a black Canvas when adding X axis HOT 1
- refresh data from JSON with ajax ?
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 rickshaw.