Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative values in charts. #8

Open
cablegunmaster opened this issue Apr 25, 2016 · 2 comments
Open

Negative values in charts. #8

cablegunmaster opened this issue Apr 25, 2016 · 2 comments

Comments

@cablegunmaster
Copy link

cablegunmaster commented Apr 25, 2016

http://nikopol.github.io/Harry-Plotter/#tab=generator
I can't get a chart to have a [1,0,-1] limit, values in this simple chart.

Ideally I want to be able to make a chart with steps of: "1,0.8,0.6,0.4,0.2,0,-0.2,-0.4.-0.6,-0.8,-1.0,-1.2,-1.4,-1.6" Of Y-axis value steps. with values of "-0.239,-0.742,-0.900,-1.0" for example. so its a very small graph. but the information itself is very small. But won't resize on the screen.

The X-axis is just a label. But with the stacked graph it won't resize these values.
Is it possible to make a negative graph out of this, with a positive one on top? Like dual graph.
One negative the other stack is positive.

It doessn't seem to handle negative values that well, for the rest Its a awesome javascript library, keep up the good work! 👍

Thanks for reading the request.
Hopefully I have made myself clear.

@nikopol
Copy link
Owner

nikopol commented Apr 25, 2016

Hi,
actually you can do it with two graphs as you said, using the options mirror:{y:true} option for yours negatives values (but you'll need to provide Math.abs value anyway).
example : http://plnkr.co/edit/wlHx0YRhtHcHVqIQhtIv?p=preview

I'll try to find the time to do it in a prettiest way with one graph.

@gtimoshaz
Copy link

@nikopol I tried to fix it, but it was impossible for me to read your code, so here's an idea how to fix. You can found minimal Y global_minimum value in all datasets and then subtract global_minimum from Y labels before output it. I. e. replace gc.fillText(v, x, y) with gc.fillText(v-global_minimum, x, y)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants