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

Incorrect graph with all zero values #13

Open
juhamust opened this issue Feb 7, 2012 · 5 comments
Open

Incorrect graph with all zero values #13

juhamust opened this issue Feb 7, 2012 · 5 comments
Labels

Comments

@juhamust
Copy link

juhamust commented Feb 7, 2012

The graph is shown incorrectly when all the values are zero:

  • Line graph: straight line above the graph, no labels
  • Bar graph: all full bars
  • Etc.

Expected outcome is have flat line/bars at level 0.

var placeholder = document.getElementById('graph');

// var values = [0, 1, 4, 3];  // <-- OK
var values = [0, 0, 0, 0];  // <-- NOK
new Ico.LineGraph(placeholder, values, 
{colour:'#ff0000', labels:['one', 'two', 'three', 'four'], height:300, width: 300}
);

Used versions:

  • Ico (latest from master): 15e69ac
  • Raphael.js: 2.0.1
@alexyoung
Copy link
Owner

I'll take a look

@alexyoung
Copy link
Owner

The values were coming out as NaN

@alexyoung
Copy link
Owner

I just pushed a fix for this, let me know if it does what you want.

@juhamust
Copy link
Author

juhamust commented Feb 8, 2012

Looks quite good: Line graph is shown as expected, but bar graph is not showing any bars (it could show flat bars at zero level as well).

However, I'm fine with the current solution - thanks for the quick response and fix!

@alexyoung
Copy link
Owner

Yeah, I think the bar should show at least a line at zero else it might be misread as a missing value rather than 0. I'll keep this open until I figure that out.

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

No branches or pull requests

2 participants