Skip to content

Conversation

@tannerlinsley
Copy link
Contributor

This fixes bad values from killing the chart. NaN, undefined, and null are now all treated the same.

skipNull and drawNull are no longer options in the line element. There weren’t used much, because quite frankly, they didn’t work! Now it’s all automagical, and bad values won’t be drawn.

You can still manually skip a point by marking that point’s _model with a skip: true property.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok to lose the return?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah

@etimberg
Copy link
Member

Sounds good. As soon as tests pass, this is good to merge 😄

This particular part of testing was succeeding in chrome, and failing
in firefox.  It should be rounded anyway.
The rounding problems compounded in a few areas (like the
distanceFromCenter function and drawingArea property).  Those are now
more accurate.
tannerlinsley added a commit that referenced this pull request Oct 24, 2015
@tannerlinsley tannerlinsley merged commit 6dc651a into v2.0-dev Oct 24, 2015
@tannerlinsley tannerlinsley deleted the v2.0-dev-skip-null-fixes branch October 24, 2015 07:35
@emcniece
Copy link

emcniece commented May 18, 2016

I'm curious about the skipNull feature, especially now that I need it ;)

My use case: line chart plotting multiple series, dates on the x-axis. Each series may or may not have a point on a given date. Instead of having the line interrupt, I would prefer to have it join up to the next point!

I am currently using Chart.js v2.1.3 in conjunction with http://jtblin.github.io/angular-chart.js/

screen shot 2016-05-17 at 5 59 53 pm

@emcniece
Copy link

So far I have managed to extend the line chart controller and am able to set point._model.skip=true for given points, but this results in the same behaviour that currently exists - the series breaks, then continues at the next point. (duh, that's what this PR is all about)

What can we do to make the line continuous? I'm currently thinking about averaging the surrounding points, plotting a fake point in between (with the averaged values) and hiding the point with radius=0. Any other suggestions?

@deanshub
Copy link

deanshub commented Jul 2, 2016

As of #2721 you can add the spanGaps attribute which allows this skipping ability as described here

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

Successfully merging this pull request may close these issues.

5 participants