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

is it possible to have discontinuous line graphs? #38

Open
jessicah opened this issue May 12, 2010 · 5 comments
Open

is it possible to have discontinuous line graphs? #38

jessicah opened this issue May 12, 2010 · 5 comments

Comments

@jessicah
Copy link

I'd like to use the line graphing for a sports tracker type web app, and when a workout has a break in it (e.g. paused at one spot, and resumed at another), i would like to represent the break as a discontinuity in the line graph, e.g. the two endpoints on either side of the 'break' as open circles joined by a straight dashed line, whereas the normal continuous line would be solid.

@davidsonff
Copy link

I am also wondering this... Frequently when graphing data it is useful to have a gap when data is not present. Right now I am looking at modifying the graphael source to see if I can change some of the path "L"s to "M"s, but it seems like a useful thing to add...

@davidsonff
Copy link

I changed line 193 of g.line.js to:

                path = path.concat([(j && (valuesy[i][j] !== null)) ? "L" : "M", X, Y]);

... and I'm testing it now.... If passed a null y value it skips that point (so far!)...

@davidsonff
Copy link

Changed it again to account for null x values:

                path = path.concat([(j && (valuesy[i][j] !== null) && ((valuesx[i] || valuesx[0])[j] !== null)) ? "L" : "M", X, Y]);

@davidsonff
Copy link

g.line.js v. 0.51 that is... Sorry to be leaving so many comments...

@Fiendfyre
Copy link

Line 193 should be this, so the line graph won't start from a y-datapoint which is null
path = path.concat([(j && (valuesy[i][j] !== null && valuesy[i][j-1] !== null))? "L" : "M", X, Y]);

Adding if(valuesy[i][j] !=null) around this line :
(Raphael.is(sym, "array") ? sym[j] : sym) && symset.push(paper[Raphael.is(sym, "array") ? sym[j] : sym](X, Y, (opts.width || 2) * 3).attr({ fill: colors[i], stroke: "none" })); would prevent symbol being created for y - datapoint with null

correct me, if i'm wrong

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