JSFiddle - React, Tailwind, and code Playground

by Kesav Telaprolu

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://code.highcharts.com/6.2.0/highcharts.js"></script>
<div id="container" style="height:688px;width:1240px;overflow:auto;border-radius:6px;border:1px solid #dbdbdb;position:relative"></div>

CSS

@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") format("woff2");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "KantarBrownWeb-Thin";
  src: url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-Thin.eot");
  src: url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-Thin.eot?#iefix") format("embedded-opentype"), url("https://riofontstorage.blob.core.windows.net/kantar-fonts/KantarBrownWeb-Thin.woff2") format("woff2");
  font-weight:...

JavaScript

(input => {

var chartWrapper = $("<div></div>").appendTo("#container")
    .attr("id", "chart_wrapper");
var chartDiv = $("<div></div>").appendTo("#chart_wrapper")
    .attr("id", "chart_div");
$('#chart_wrapper').append(`<style>

/* Use for 3 lines of text before truncation */
.mle-3 {
overflow: hidden;
position: relative;
line-height: 1.1em;
max-height: 2.7em; 
padding: 1em 1em 0.4em 0em;
}

.mle-3:before {
content: '...';
position: absolute;
right: 0;
bottom: 0;
}

.mle-3:after {
content: '';
position: absolute;
right: 0;
width: 1em;
height: 2em;
margin-top: 0em;
background: #FFFFFF;
}
.concepts {
font-weight:700;
width:110px;
font-family:KantarBrownWeb-Bold;
font-size:17px;
color:#000000;
white-space: normal;
word-wrap:break-word;
}

/* Use for 6 lines of text before truncation */
.mle-6 {
overflow: hidden;
position: relative;
line-height: 1em;
max-height: 5.4em; 
text-align: center;
padding: 1em 1em 0.4em 0em;
margin: 0px;
}

.mle-6:before {
content: '...';
position: absolute;
right: 0;
bottom: 0;
}

.mle-6:after {
content: '';
position: absolute;
right: 0;
width: 1em;
height: 1em;
margin-top: 0.2em;
background: #FFFFFF;
}
.concepts1 {
font-weight:700;
width:150px;
font-family:KantarBrownWeb-Bold;
font-size:17px;
color:#000000;
white-space: normal;
word-wrap:break-word;
}
</style>`);

var CurrentShareValues = input.chartData.competitorBrandsAverage.marketShare;
var projectedValues = input.chartData.competitorBrandsAverage.powerInTheMind;
var DifferenceValues = input.chartData.competitorBrandsAverage.equityGap;
var chosenBrandValues = [input.chartData.chosenBrand.marketShare, input.chartData.chosenBrand.powerInTheMind, input.chartData.chosenBrand.equityGap];
var chosenBrandName = "";
var CmpBrandNames = [input.chartData.competitorBrandsAverage.name];

var marketShareWidth;
var pimWidth;
var allBrandmarketShareWidth;
var allBrandPimWidth;
var templs = {
    "charttile": "Potential Market Share Flows by Market Factor <br> This report shows the specific...