Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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