"use strict";var fee_comparison_portlet=new function(){this.charts={}};fee_comparison_portlet.create_chart=function(data,form_id,message){var font_size=13;var total_cost=[];var fee_internal=[];var tags=[];var $container=$("#"+form_id).empty();var ticks=[];var index=0;$.each(data,function(idx){total_cost.push([index,new Number(this.total_cost)]);fee_internal.push([index+.1,new Number(this.fee_internal)]);tags.push([index+.5,this.name]);ticks.push(this.name);index++});var plot=$.plot($container,[{data:total_cost,color:"#DD1231",label:lang_fees.total_costs},{data:fee_internal,color:"#77AB7B",label:lang_fees.fee_internal}],{series:{bars:{show:true,barWidth:.8}},grid:{backgroundColor:{colors:["#FFFFFF","#BBBBBB"]},labelMargin:11,hoverable:true},xaxis:{color:"#101010",ticks:tags,labelHeight:130,font:{size:font_size},rotation:45},yaxis:{tickFormatter:function formatter(val,axis){return $.stringFloati18n(val)},font:{size:font_size},color:"#101010"},legend:{position:"nw",backgroundOpacity:0,noColumns:2}});var currBarY=false;$("#"+form_id).unbind("plothover").bind("plothover",function(event,pos,item){if(item){var y=item.datapoint[1].toFixed(2);if(currBarY!==y){$("#"+form_id+"_tooltip").html($.stringFloati18n(y)).closest("#tooltip").css("visibility","visible");currBarY=y}}else{if(currBarY!==null){$("#"+form_id+"_tooltip").closest("#tooltip").css("visibility","hidden");currBarY=null}}}).tooltipold({track:true,bodyHandler:function(){return'<div id="'+form_id+'_tooltip"></div>'}});fee_comparison_portlet.charts[form_id]=plot.getCanvas();$container.append('<p class="formcoll"><a class="dialog_make_text_btn ui-corner-all" onclick="basicForm.open_image_window(fee_comparison_portlet.charts[\''+form_id+"'].toDataURL());\">"+lang_basic.show_image+"</a></p>");$container.append('<p class="formcoll">'+message+"</p>")};