JSFiddle - React, Tailwind, and code Playground

by Kesav Telaprolu

HTML

<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<div id="container" style="width: 1240px;height: 688px;border-radius: 10px;border: 1px solid #dbdbdb;position:relative"></div>

CSS

/*
 * 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 => {
    aided=[],Evoked =[],UsageBox=[],PIM=[],cons=[],ms=[],subheader=[],Totala=[];
var rightAlignValue = 25;
DrawConversionModelChart();


var templs = {
                "charttile":"This chart provides an overview of a brand's Awareness, Consideration, Usage, Power in the mind and Market Share. It tracks the client brand in comparison to 5 competitor brands, at one point in time.",
                "AidedHeader":"Measures the percentage of respondents who express knowledge of the brand when prompted (brand recognition)",
                "AidedSegment":"<brand> has an Awareness of <cm_au1b>%.",
                "EvokedHeader":"Measures the percentage of respondents who use, or would consider using the brand. ",
                "EvokedSegment":"<cm_evoked_set>% of respondents who are aware of <brand> use or would consider using it.",
                "consider":"Measures the percentage of respondents who consider using the brand.",
                "considersagment":"<brand> has a Consideration of <cm_au2>%.",
        
                "Usage":"Measures the percentage of respondents who are using the brand.",
                "UsageSegment":"<brand> has a Usage of <cm_au3a>%.%",

                "Pim" :"Measure of attitudinal preference/appeal and how people feel about the brand.",	
                "PimSegment": "<brand> has a Power in the mind of <cm_power_in_the_mind>%.",
            
                "Ms":"Measures the estimated share of market for the brand.	",
                "MsSegments":"<brand> has a Market Share of <cm_market_share>%.",
                
              
} 

    var tmpl1 = '<div style="z-index:1;font-family:KantarBrownWeb-Light;font-size: 17px;color: #000000;position:absolute;width:503px; box-sizing: border-box; padding: 10px; border: 1px solid #ccc;background:#FFF;box-shadow: 0px 2px 10px 0px rgba(0,0,0,.3);border-radius:5px" id="tip"></div>'; 
 



function GenerateChart() {
    $("#chart_div").html(null);
    //TITLE TEMPLATE
    var...