function updateArtistPerformanceData(n,t,i,r){var e=n.data("chart"),u,f;e.showLoading("Loading...");u="/Ajax/Charts/"+t;f={encIdArtist:$("#artistIdHid").val(),encCurrency:i,encCat:r,isShowToEmployee:!1};$.ajax({type:"POST",url:u,data:f,success:function(t){n.data("result",t);refreshGraphIndex(n)}})}function isAllArrayValuesZero(n,t){for(t=t;t1?"."+x[1]:"";for(var t=/(\d+)(\d{3})/;t.test(x1);)x1=x1.replace(t,"$1,$2");return x1+x2}var t=$("input[type='radio']:checked",$("#currSelContainerMed")).val(),i=$("#rbCatMed").val();MedianlabelCurrencyFormatter=function(){return currencySign+n(Math.round((this.value||this.value==0?this.value:this.y)*100)/100)};tooltipFormatter=function(){var t=""+this.series.name+"<\/b>
";return t+(this.series.name.split("Lots").length==1?this.x+": $"+n(Math.round(this.y*100)/100):this.x+": "+this.y)};window.currentBmFromArtwork&&(showChart({id:"med-performance-chart",method:"ArtworkBroadMediaPricesAvgMed",params:{idBM:window.currentBmFromArtwork,encCurrency:t,encIdArtist:currentIdArtist},type:"line",format:"${point.y:,.0f}",dataLabels:!0,marker:!0,markerRadius:2,tooltipFormatter:tooltipFormatter,get_categories:"Years",series:[{color:"#febb14",zIndex:2,type:"spline",name:"Average Sold Lot Value",get:"RealAvg"},{color:"#00A076",zIndex:2,type:"spline",name:"Median Sold Lot Value",get:"RealMed"},]}),Highcharts.setOptions({lang:{thousandsSep:","}}));return});$(document).ready(function(){function t(n){n+="";x=n.split(".");x1=x[0];x2=x.length>1?"."+x[1]:"";for(var t=/(\d+)(\d{3})/;t.test(x1);)x1=x1.replace(t,"$1,$2");return x1+x2}function r(n){var t=$(n.target.container);t.data("chart",n.target);u(t)}function u(n){var t=n.data("chart");t.showLoading("Loading...");$.post("/Ajax/Charts/ArtworkBroadMediaPricesSellThroughRate",{idBM:window.currentBmFromArtwork,encCurrency:1,encIdArtist:currentIdArtist},function(t){f(t,n)})}function f(n,t){var f,i,r,u,o;if(n)try{if(typeof options!="undefined"&&typeof options.LastItemToFullPercent!="undefined")for(f=options.series[options.series.length-1].get,i=0;i0?r:0}t.data("result",n);e(t)}catch(s){console.log("chartSellThroughRate SetChartData");console.log(s)}}function e(n){var t=n.data("result"),i=n.data("chart"),u,f,r;for(i.hideLoading(),u=formatResultString(t,t.TitleFormat),f=formatResultString(t,t.SubTitleFormat),i.xAxis[0].setCategories(t.Years,!1),r=0;r<1;r++)i.series[r].setData(t.sales_percent,!0);i.redraw()}var i,n;tooltipFormatter=function(){var n=""+this.series.name+"<\/b>
";return n+(this.series.name.split("Lots").length==1?this.x+": "+t(Math.round(this.y*100)/100)+"%":this.x+": "+this.y)};window.currentBmFromArtwork&&(i=[0,20,40,60,80],n={chart:{renderTo:"artwork-graph-sale-through-rate",type:"area",events:{load:r}},lang:{thousandsSep:","},legend:{margin:30},title:{text:""},xAxis:{allowDecimals:!1,labels:{formatter:function(){return this.value}}},yAxis:{max:100,title:{text:""},labels:{formatter:function(){return this.value+"%"}}},tooltip:{enabled:!0,formatter:typeof tooltipFormatter!="undefined"?tooltipFormatter:null},exporting:{enabled:!1},plotOptions:{area:{dataLabels:{enabled:!0,format:"{y}%"},marker:{enabled:!0,symbol:"circle",radius:3,states:{hover:{enabled:!0}}}}},credits:{enabled:!1},navigation:{buttonOptions:{enabled:!1}},series:[{name:"Sell-through Rate"}]},new Highcharts.Chart(n))})