Skip to content

Instantly share code, notes, and snippets.

@jacobian
Created April 28, 2011 18:19
Show Gist options
  • Select an option

  • Save jacobian/946927 to your computer and use it in GitHub Desktop.

Select an option

Save jacobian/946927 to your computer and use it in GitHub Desktop.
max = Math.max.apply.bind(Math.max, {});
min = Math.min.apply.bind(Math.min, {});
// Plot symbols just for the first, last, highest, and lowest values.
// gRaphael wants symbols to be an array of characters to write for
// each point. E.g. ['o', '', '', ..., 'o', ..., '', '', 'o']
var symbols = data.values.map(function() { return '' });
symbols[0] = 'o';
symbols[symbols.length-1] = 'o';
symbols[symbols.lastIndexOf(max(data.values))] = 'o';
symbols[symbols.lastIndexOf(min(data.values))] = 'o';
console.log(symbols);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment