/*
* Legal Disclaimer
*
print '\n', 'Note that the webfonts share the TT sources'
* These Fonts are licensed for unlimited use on domains and their subdomains of The Kantar Group.
* It is illegal to download or use them on other websites.
*
* While the @font-face statements below may be modified by the client, this
* disclaimer may not be removed.
*
* Lineto.com, 2016
*/
@font-face {
font-family: "KantarBrownWeb-LightItalic";
src: url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-LightItalic.eot");
src: url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-LightItalic.eot?#iefix") format("embedded-opentype"),
url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-LightItalic.woff2") format("woff2"),
url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-LightItalic.woff") format("woff");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "KantarBrownWeb-BoldItalic";
src: url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-BoldItalic.eot");
src: url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-BoldItalic.eot?#iefix") format("embedded-opentype"),
url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-BoldItalic.woff2") format("woff2"),
url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-BoldItalic.woff") format("woff");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "KantarBrownWeb-Italic";
src: url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-Italic.eot");
src: url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-Italic.eot?#iefix") format("embedded-opentype"),
url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-Italic.woff2")...
JavaScript
(input => {
var defaultHeight = 45;
var chartWrapper = $("<div></div>").appendTo("#container")
.attr("id", "chart_wrapper");
var chartDiv = $("<div></div>").appendTo("#chart_wrapper")
.attr("id", "chart_div");
var msv = input.cmpBrands.map(function(item){
return item.marketShare;
})
var pim = input.cmpBrands.map(function(item){
return item.powerInTheMind;
})
var maxChosenBrand = Math.max.apply(null, [input.chosenBrand.marketShare,input.chosenBrand.powerInTheMind,input.chosenBrand.equityGap]);
var maxMSCmpBrands = Math.max.apply(null, msv);
var maxProjectedCmpBrands = Math.max.apply(null, pim);
var MaxBrandValue = Math.max(maxMSCmpBrands, maxProjectedCmpBrands, maxChosenBrand);
//Declare the context
var canvasComparison;
var ctxComp;
var canvasChosen;
var ctxChosen;
var constMaxSquareSize = 105;
var pimSwitch = false;
//Default display
DisplayDefault();
function DisplayDefault() {
InitChart();
displayAll();
return;
}
//Display market share only
function displayMSOnly() {
pimSwitch = false;
//Draw chosen brand based on the max size in series
DrawPlotForChosenBrand(input.chosenBrand.marketShare, 0, '', input.chosenBrand.name);
var minimumGap = 0;
//Comparision Brand Plot
for (var i = 0; i < input.cmpBrands.length; i++) {
//setting the projected values to 0 by default
DrawPlotForComparisionBrands(input.cmpBrands[i].marketShare, 0, '', minimumGap, input.cmpBrands[i].name, i);
minimumGap += 117;
}
}
//Display power in mind only
function displayPMOnly() {
pimSwitch = true;
//Draw chosen brand based on the max size in series
DrawPlotForChosenBrand(0, input.chosenBrand.powerInTheMind, '', input.chosenBrand.name);
var minimumGap = 0;
//Comparision Brand Plot
for...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.