Skip to content

Instantly share code, notes, and snippets.

@retorquere
Created November 9, 2009 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save retorquere/230198 to your computer and use it in GitHub Desktop.
Save retorquere/230198 to your computer and use it in GitHub Desktop.
ideal = [ 178.0,168.111111111,158.222222222,148.333333333,138.444444444,128.555555556,118.666666667,108.777777778,98.8888888889,89.0,79.1111111111,69.2222222222,59.3333333333,49.4444444444,39.5555555556,29.6666666667,19.7777777778,9.88888888889,0.0 ];
hours = [ 178.00,148.00,148.00,129.00,122.00,114.00,114.00,77.00,74.00,74.00,58.00,58.00,58.00,26.00,26.00,26.00,26.00,26.00,26.00 ];
storypoints = [ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ];
// jqplot currently can't handle series that have all the
// same datapoints
p = storypoints[0];
bug = true;
for (i in storypoints) {
if (storypoints[i] != p) {
bug = false;
break;
}
}
bug = false;
if (bug) {
storypoints = hours.slice();
pmax = 178.00;
} else {
pmax = 0;
}
plot1 = $.jqplot('graph', [ideal, storypoints, hours], {
legend:{show:true, location:'sw'},
grid:{shadow:false},
seriesDefault:{shadow:false},
series:[
{label: 'Ideal', yaxis: 'yaxis'},
{label: 'Points', yaxis:'y2axis'},
{label: 'Hours', yaxis: 'yaxis'}
],
axes:{
xaxis:{min:1, max:19, tickInterval:1, tickOptions:{formatString:'%d'}},
y2axis:{min:0, max:pmax * 1.01, tickOptions:{formatString:'%d'}},
yaxis:{min:0, max:178.00 * 1.01, tickOptions:{formatString:'%d'}}
},
highlighter:{
tooltipAxes: 'y',
formatString: '%s'
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment