function plotCharts(){plotPieChart();plotPieChartLegend();plotBarChart();plotStackedBarChart();plotLineChart();plotLineBarChart()}function plotPieChart(){var a=[2,6,7,3];var c=a.map(function(d){return{data:d}});var b={series:{pie:{show:true}}};$.plot($("#piechart"),c,b)}function plotPieChartLegend(){var a=[2,6,7,3];var c=a.map(function(d,e){return{label:"val"+(e+1),data:d}});var b={series:{pie:{show:true}},legend:{show:true,labelFormatter:function(d,e){return'<a href="http://www.google.de" target="_blank">'+d+"</a>"}}};$.plot($("#piechart_legend"),c,b)}function plotBarChart(){var d=[[0,3],[2,8],[4,5],[6,13],[8,13],[10,12],[12,20],[14,13],[16,3],[18,8],[20,13],[22,40]];var c=["Jan","Feb","Mrz","Aprl","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"];var a={data:d,bars:{show:true,barWidth:0.5,align:"center"}};var b={xaxis:{ticks:[[0,"Jan"],[2,"Feb"],[4,"Mar"],[6,"Apr"],[8,"May"],[10,"Jun"],[12,"Jul"],[14,"Aug"],[16,"Sep"],[18,"Oct"],[20,"Nov"],[22,"Dez"]]}};$.plot($("#barchart"),[a],b)}function plotStackedBarChart(){var d=[8,-5,7,8,4,12];var c=[3,-4,6,2,5,2];var b=[];d=d.map(function(e,f){return[f,e]});c=c.map(function(e,f){return[f,e]});b=d.map(function(e,f){return[f,"v"+f]});var a={series:{stack:true,bars:{show:true,barWidth:0.5,align:"center"}},xaxis:{ticks:b}};$.plot($("#stackedbarchart"),[d,c],a)}function plotLineChart(){var c=[8,5,7,8,4,12,10,11,9];var b=[3,4,6,2,5,2,5,3,4];c=c.map(function(d,e){return[e,d]});b=b.map(function(d,e){return[e,d]});var a={series:{lines:{show:true},points:{show:true}},xaxis:{show:true,ticks:[[0,"v1"],[1,"v2"],[2,"v3"],[3,"v4"],[4,"v5"],[5,"v6"],[6,"v7"],[7,"v8"],[8,"v9"]]},grid:{hoverable:true,clickable:true}};$("#linechart").bind("plothover",function(f,h,e){$("#x").text(h.x.toFixed(2));$("#y").text(h.y.toFixed(2));$("#tooltip").remove();var d=e.datapoint[0].toFixed(2);var g=e.datapoint[1].toFixed(2);showTooltip(e.pageX,e.pageY,e.series.label+" of "+d+" = "+g)});$.plot($("#linechart"),[{data:c,label:"series1"},{data:b,label:"series2"}],a)}function plotLineBarChart(){var d=[8,5,7,8,4,12,10,11,9];var c=[3,4,6,2,5,2,5,3,4];var b=[[0,3],[4,8],[8,5],[9,13]];d=d.map(function(e,f){return[f,e]});c=c.map(function(e,f){return[f,e]});var a={series:{lines:{show:true},points:{show:true}},xaxis:{show:true,ticks:[[0,"v1"],[1,"v2"],[2,"v3"],[3,"v4"],[4,"v5"],[5,"v6"],[6,"v7"],[7,"v8"],[8,"v9"]]},grid:{hoverable:true,clickable:true}};$("#linebarchart").bind("plothover",function(g,i,f){$("#x").text(i.x.toFixed(2));$("#y").text(i.y.toFixed(2));$("#tooltip").remove();var e=f.datapoint[0].toFixed(2);var h=f.datapoint[1].toFixed(2);showTooltip(f.pageX,f.pageY,f.series.label+" of "+e+" = "+h)});$.plot($("#linebarchart"),[{data:d,label:"series1"},{data:c,label:"series2"},{data:b,label:"series3",bars:{show:true}}],a)}function showTooltip(a,c,b){$('<div id="tooltip">'+b+"</div>").css({position:"absolute",display:"none",top:c+5,left:a+5,border:"1px solid #fdd",padding:"2px","background-color":"#fee",opacity:0.8}).appendTo("body").fadeIn(200)};