JSFiddle - React, Tailwind, and code Playground

by Kesav Telaprolu

HTML

<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/6.1.1/highcharts.js"></script>
<head>
    <style>
        /*
 * 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:...

JavaScript

(input => {
 
 var maxValue=[
Math.max.apply(Math, input.chartData.brandFluencyData[0].data),
Math.min.apply(Math, input.chartData.brandFluencyData[0].data),
input.chartData.Norm,
input.chartData.Top25norm
];

maxValue.sort(function(a, b){return b - a});

console.log(maxValue);
var tickval = 10,min,max;
max=Math.round((parseInt(maxValue[0]/10, 10)+1)*10);
min=Math.round(parseInt(maxValue[3] / 10, 10) * 10);
if(input.chartData.Norm<min)
{
    min=input.chartData.Norm;
}
if(Math.round(parseInt(maxValue[0])-parseInt(maxValue[3]))<=10)
{
    tickval=2;
}
else if(Math.round(parseInt(maxValue[0])-parseInt(maxValue[3]))>10 && Math.round(parseInt(maxValue[0])-parseInt(maxValue[3]))<=40)
{
    tickval=5;
}
else if(Math.round(parseInt(maxValue[0])-parseInt(maxValue[3]))-Math.round(parseInt(maxValue[0])-parseInt(maxValue[3]))>40)
{
    tickval=10;
}

var pointWidth=80;

if(input.chartData.waves.length<=3)
{
    pointWidth=241;
}
else if(input.chartData.waves.length<=5)
{
    pointWidth=140;
}

console.log("tickval"+tickval + "Min" + min + "max" +max);
    var chartHeader = `<div id=title></div>
       <div  id=chartTitle1 >${input.chartData.brandFluencyData[0].name}</div>`;
    
    var strengthsAndWeeknesses = "<div id='strengthsAndWeeknessesChart'></div>";

    var footer = 
`  <div id="legendWrapper">     
       <div class="legend"> 
             <p class="legend-name">
            <span class="legend-dot No"></span><span style="position:relative;top">No Relationship</span></p> 
     </div>
     
     <div class="legend"> 
             <p class="legend-name">
            <span class="legend-dot weak"></span>Weak Relationship</p> 
     </div> 
     
     <div class="legend"> 
             <p class="legend-name">
            <span class="legend-dot avg"></span>Average Relationship</p> 
     </div> 

     <div class="legend"> 
             <p class="legend-name">
            <span class="legend-dot strong"></span>Strong Relationship</p> 
     </div> 
    </div>
`;
     ...