// JavaScript Document var $chartDiv = $("#chart-div"); var chart; var actIndustry; var actId = 0; var selected = false; var cCategories; var cData2; var cColors = [ "#52575b", "#5b6064", "#64696c", "#6e7275", "#777b7e", "#808487", "#898d90", "#939698", "#9c9fa1", "#a5a8aa", "#aeb1b3", "#b8babb", "#c1c3c4", "#cacccd", "#d4d5d6", "#e1e2e3", "#e1e2e3" ]; var cData = [ {name: "aaranca_creations",y: 14,sliced: true,selected: true, active:true }, ["alt_entertainment", 1], ["balaji_telefilms", 2], ["big_screen", 3], ["chocohollics", 4], ["dar_motion_pictures", 5], ["Disney", 6], ["Eros_International", 7], ["Escape_artists", 8], ["Fox_star_Studios", 9], ["high_grounds", 10], ["ibf", 11], ["idf", 12], ["jmj", 13], ["lilac", 14], ["Maac", 15], ["Medient", 16], ["moserbaer", 17], ["Mumbai Mantra", 18], ["Nadiadwala", 19], ["Prakash Jha", 20], ["Preeti Desai", 21], ["Reliance Big", 22], ["Revel Films", 23], ["rotary", 24], ["Satya Ashwmi", 25], ["Shemaroo", 26], ["Sony Entertainment Television", 27], ["Sony Pictures", 28], ["Sony Pix", 29], ["Tips", 30], ["twilight", 31], ["Universal", 32], ["Utv", 33], ["Utv Bindass", 34], ["Utv Spotboy", 35], ["Walkwalker", 36], ["Warner Brothers", 37], ["Wide Frame", 38], ["Zee Studio", 39], ]; var cCategories = ["aaranca_creations", "alt_entertainment", "balaji_telefilms", "big_screen", "chocohollics", "dar_motion_pictures", "Disney", "Eros_International", "Escape_artists", "Fox_star_Studios", "High_Grounds", "IBF", "IDF", "JMJ Entertainment", "Lilac Insights", "Maac", "Medient", "Mosarbaer", "Mumbai Mantra", "Nadiadwala", "Prakash Jha", "Preeti Desai", "Reliance Big", "Revel Films", "Rotary Club of Mumbai Lakers", "Satya Ashwmi", "Shemaroo", "Sony Entertainment Television", "Sony Pictures", "Sony Pix", "Tips", "Twilight", "Universal", "Utv", "Utv Bindass", "Utv Spotboy", "Walkwalker", "Warner Brothers", "Wide Frame", "Zee Studio"]; var cData2 = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39]; actIndustry = "aaranca_creations"; var initialized = false; var outClass = {'font-family': 'adelle-n3, adelle, Georgia, "Times New Roman", Times, serif','font-weight':'300','font-style':'normal'}; var overClass = {'font-family': 'adelle-n7, adelle, Georgia, "Times New Roman", Times, serif','font-weight':'700','font-style':'normal'}; if($.client.os == "Windows"){ if($.client.browser == "Safari" || $.client.browser == "Chrome"){ overClass = {'font-family': 'adelle-n7, adelle, Georgia, "Times New Roman", Times, serif','font-weight':'normal','font-style':'normal'}; } } var ua = $.browser; if ( ua.mozilla && ua.version.slice(0,3) == "1.9" ) { $('div.column-wrapper').find('h3:first-child').css("margin-top","0px"); } $(document).ready(function() { //reInit(); $("#chart-div").hover(function() { highLight(); },function(){ // resetColor(); }); $("#chart-info").hover(function() { highLight(); },function(){ // resetColor(); }); // setup category/industry list $('#chart-info li').each(function(index) { var cid = $(this).attr("id"); $(this).find('span').css('background-color', cColors[cid]); if(cid == 0){ $(this).find('p').css(overClass); } $(this).find('p').css(outClass); $(this).hover( function () { if(chart.series[0].data[cid].active != true){ chart.series[0].data[cid].select(); } $(this).find('span').css('background-color', cColors[0]); $(this).find('p').css(overClass); resetIndustryList(index); }, function () { //$(this).find('span').css('background-color', cColors[cid]); } ); }); // show the clients list $('div.client-list').each(function(index) { if($(this).attr("title")==actIndustry){ $(this).addClass("shown").removeClass("hidden"); }else{ $(this).stop().fadeOut(0); } }); $('div.column-wrapper').makecolumns({ colwidth:236, ulheight:500, btmOffset:10, lineHeight:20 }); // View functions initClientSection(); }); function resetIndustryList(active){ $('#chart-info li').each(function(index) { if(index != active){ $(this).find('p').css(outClass); } }); } function moveList(b){ var end = $('div#section-clist-container').width() - $('div.column-wrapper').width()+34; if(b){ $('div.column-wrapper').animate({marginLeft:10}, 'slow'); }else{ $('div.column-wrapper').animate({marginLeft:end}, 'slow'); } } function viewToggle(){ // animate div $('div#clients-sections-container').animate({marginLeft: '-10px'} , '600', function(){ $('div#section-clist-container').css("height", "auto"); }); $('div.clientView p:first-child').stop(true,true).animate({opacity:0},'600', function() { $(this).css("cursor","default"); }); $('div.clientView p:last-child').stop(true,true).animate({opacity:0},'600', function() { $(this).css("cursor","default"); }); var p2 = $('div.clientView').find($('div.clientView p')[2]); p2.removeAttr("title"); p2.removeClass('actView'); var p1 = $('div.clientView').find($('div.clientView p')[1]); p1.attr("title","active"); p1.addClass('actView'); } function initClientSection(){ $('div.clientView p:first-child').stop(true,true).animate({opacity:0},'600', function() { $(this).css("cursor","default"); }); $('div.clientView p:last-child').stop(true,true).animate({opacity:0},'600', function() { $(this).css("cursor","default"); }); $('div.clientView p').each(function(index) { $(this).hover(function(){ if(index == 0){ $(this).addClass('actPrev'); $(this).removeClass('prev'); } else if(index == 3){ $(this).addClass('actNext'); $(this).removeClass('next'); }else{ $(this).addClass('actView'); } },function(){ if(index == 0){ $(this).removeClass('actPrev'); $(this).addClass('prev'); } else if(index == 3){ $(this).removeClass('actNext'); $(this).addClass('next'); }else{ if($(this).attr("title")!="active"){ $(this).removeClass('actView'); } } }).click(function(){ if(initialized==false){ reInit(); viewToggle(); initialized = true; } if(index==2){ if($(this).attr("title")!="active"){ $(this).attr("title","active"); $(this).addClass('actView'); var p = $('div.clientView').find($('div.clientView p')[1]); p.removeAttr("title"); p.removeClass('actView'); $('div.clientView p:first-child').css({"display":"block"}); $('div.clientView p:last-child').css({"display":"block"}); $('div.clientView p:first-child').stop(true,true).animate({opacity:1},'600').css("cursor","pointer"); $('div.clientView p:last-child').stop(true,true).animate({opacity:1},'600').css("cursor","pointer"); $('div#clients-sections-container').animate({marginLeft: '-938px'} , '600'); } $('div#section-clist-container').height(500); } if(index==1){ if($(this).attr("title")!="active"){ $(this).attr("title","active"); $(this).addClass('actView'); var p = $('div.clientView').find($('div.clientView p')[2]); p.removeAttr("title"); p.removeClass('actView'); $('div.clientView p:first-child').stop(true,true).animate({opacity:0},'600', function() { $(this).css("cursor","default"); }); $('div.clientView p:last-child').stop(true,true).animate({opacity:0},'600', function() { $(this).css("cursor","default"); }); $('div#clients-sections-container').animate({marginLeft: '-10px'} , '600'); } $('div#section-clist-container').css("height", "auto"); } if(index==0){ moveList(true); } if(index==3){ moveList(false); } }); }); } function selectIndustry(id,industry){ // show/hide the active clients list $('div.client-list').each(function(index) { if($(this).attr("title")!=industry){ $(this).removeClass("shown").addClass("hidden"); //$(this).fadeOut(0); }else{ $(this).removeClass("hidden").addClass("shown"); //$(this).fadeIn(400); } }); // change the style of the category list $('#chart-info li').each(function(index) { var cid = $(this).attr("id"); if(id == cid){ $(this).find('span').css('background-color', cColors[0]); $(this).find('p').css({'font-family':'adelle-n7, adelle, Georgia, "Times New Roman", Times, serif', "color":cColors[0]}); }else{ $(this).find('span').css('background-color', "#c1c3c4"); $(this).find('p').css({'font-family':'adelle-n3, adelle, Georgia, "Times New Roman", Times, serif',"color":"#c1c3c4"}); } }); } function highLight(){ for(var i=0; i < chart.series[0].data.length; i++){ if(i != actId){ chart.series[0].data[i].update({ color: "#c1c3c4" }); }else{ chart.series[0].data[i].update({ color: "#52575b" }); } } // change the style of the category list $('#chart-info li').each(function(index) { var cid = $(this).attr("id"); if(actId == cid){ $(this).find('span').css('background-color', cColors[0]); $(this).find('p').css({'font-family': 'adelle-n7, adelle, Georgia, "Times New Roman", Times, serif','font-weight':'700','font-style':'normal'}); }else{ $(this).find('span').css('background-color', "#c1c3c4"); $(this).find('p').css({'font-family': 'adelle-n3, adelle, Georgia, "Times New Roman", Times, serif','font-weight':'300','font-style':'normal'}); } }); } function resetColor(){ for(var i=0; i < chart.series[0].data.length; i++){ chart.series[0].data[i].update({ color: cColors[i] }); } // change the style of the category list $('#chart-info li').each(function(index) { var cid = $(this).attr("id"); if(actId == cid){ $(this).find('p').css({'font-family': 'adelle-n7, adelle, Georgia, "Times New Roman", Times, serif','font-weight':'700','font-style':'normal'}); }else{ $(this).find('span').css('background-color', cColors[cid]); $(this).find('p').css({'font-family':'adelle-n3, adelle, Georgia, "Times New Roman", Times, serif',"color":"#414042"}); } }); } function reInit(){ chart = new Highcharts.Chart({ chart: { renderTo: "chart-div", backgroundColor: null, defaultSeriesType: "pie", plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false, spacingTop: 0, spacingLeft: 0, spacingBottom: 0, spacingRight: 0, margin: [10, 0, 10, 0], animation: { duration: 500, easing: "easeOutBack" } }, credits: { enabled: false }, title: { text: null }, tooltip: { enabled:false }, colors: cColors, xAxis: { categories: cCategories }, plotOptions: { pie: { allowPointSelect: false, cursor: "pointer", shadow: false, dataLabels: { enabled: false }, showInLegend: false, size:"100%", point: { events: { select:function() { actId = this.x; this.update({color: "#52575b"}); this.active = true; //alert(this.radiusX); selectIndustry(actId, this.name); }, unselect:function() { this.update({color: "#b8babb"}); this.active = false; } } } }, series: { cursor: "pointer", states: { hover: { enabled: false } }, point: { events: { click: function() { }, mouseOver: function() { if(this.active != true){ this.select(); } } } } } }, series: [{ type: "pie", name: "Clients Chart", data: cData }] }); } function fromSidenavActive(){ if(initialized==false){ reInit(); viewToggle(); initialized = true; } }