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

Line beginning with null value, renders only dots, no line. #7

Closed
Kirkman opened this issue Oct 8, 2012 · 6 comments
Closed

Line beginning with null value, renders only dots, no line. #7

Kirkman opened this issue Oct 8, 2012 · 6 comments

Comments

@Kirkman
Copy link

Kirkman commented Oct 8, 2012

I want to draw LineGraphs that may have null values in them.

Specifically, this will be a chart showing the statistics of an NFL quarterback. Each point in the line will represent the QB's stats in a particular week of the season. However, every NFL team will have at least one "bye" week during the season -- a week where their team doesn't play.

I represent such a week as a null in the array. Here's an example:

[
[20,40,60,null,80,100,20,null,130],
[15,100,150,100,120,null,160,200,100],
[null,30,20,60,100,100,120,70,50]
],

The first two lines render okay: Ico renders a complete line, but on the weeks where there is a null, it does not render a dot.

But the third line, which begins with a null, does NOT have a line. Ico renders only dots.

@uiteoi
Copy link
Owner

uiteoi commented Oct 8, 2012

I have not succeeded in reproducing the issue using this code (using your dataset), testing on Chrome:

      var series = [
        [20,40,60,null,80,100,20,null,130],
        [15,100,150,100,120,null,160,200,100],
        [null,30,20,60,100,100,120,70,50]
      ];

      var g18 = new Ico.LineGraph( "graph18",
        series,
        {   min: min, max: max
          , font_size: 12
          , labels: labels
          , series_names: ['This Year', 'Last Year', 'Intermitent']
          , value_labels: { add_padding: false }
          , units: '$', units_position: 0
          , x_padding_right: 15
          , colors: ['#228899', '#339933', 'grey']
          , mouseover_attributes: { stroke: 'green' }
          , curve_amount: 10
          , mouse_pointer: true
          , status_bar : status_bar
          , grid: true
        }
      );

Please provvide a sample of you code showing the problem plus indicate under which browser.

@Kirkman
Copy link
Author

Kirkman commented Oct 8, 2012

Here's an example page: http://joshrenaud.com/pd/qb-compare/qb-ico-tests.html

I see the issue in all browsers I've tried: Chrome, Firefox, IE8.

@uiteoi
Copy link
Owner

uiteoi commented Oct 8, 2012

Thanks, I can see the problem. There is an error. Now trying to understand why and where precisely.

There is another problem with the two first lines: they display but there is no interruption at missing points.

@uiteoi
Copy link
Owner

uiteoi commented Oct 12, 2012

The bug happens only when option curve_amount is set to zero for which I did not have a test case. I am now working on the fix.

A workaround is to set curve_amount to 1.

uiteoi added a commit that referenced this issue Oct 12, 2012
@uiteoi
Copy link
Owner

uiteoi commented Oct 12, 2012

Thanks again Kirkman for spotting this issue. It is now fixed. Please verify.

@uiteoi uiteoi closed this as completed Oct 12, 2012
@Kirkman
Copy link
Author

Kirkman commented Oct 15, 2012

Verified.

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

2 participants