13551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)/* Flot plugin that adds some extra symbols for plotting points. 23551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 33551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)Copyright (c) 2007-2013 IOLA and Ole Laursen. 43551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)Licensed under the MIT license. 53551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 63551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)The symbols are accessed as strings through the standard symbol options: 73551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 83551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) series: { 93551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) points: { 103551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) symbol: "square" // or "diamond", "triangle", "cross" 113551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) } 123551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) } 133551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 143551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)*/(function(e){function t(e,t,n){var r={square:function(e,t,n,r,i){var s=r*Math.sqrt(Math.PI)/2;e.rect(t-s,n-s,s+s,s+s)},diamond:function(e,t,n,r,i){var s=r*Math.sqrt(Math.PI/2);e.moveTo(t-s,n),e.lineTo(t,n-s),e.lineTo(t+s,n),e.lineTo(t,n+s),e.lineTo(t-s,n)},triangle:function(e,t,n,r,i){var s=r*Math.sqrt(2*Math.PI/Math.sin(Math.PI/3)),o=s*Math.sin(Math.PI/3);e.moveTo(t-s/2,n+o/2),e.lineTo(t+s/2,n+o/2),i||(e.lineTo(t,n-o/2),e.lineTo(t-s/2,n+o/2))},cross:function(e,t,n,r,i){var s=r*Math.sqrt(Math.PI)/2;e.moveTo(t-s,n-s),e.lineTo(t+s,n+s),e.moveTo(t-s,n+s),e.lineTo(t+s,n-s)}},i=t.points.symbol;r[i]&&(t.points.symbol=r[i])}function n(e){e.hooks.processDatapoints.push(t)}e.plot.plugins.push({init:n,name:"symbols",version:"1.0"})})(jQuery);