JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.0/Chart.js"></script>
<canvas id="line-chart" height="200" width="200"></canvas>

JavaScript

//line
		var customTooltipsLine = function(tooltip) {
			// Tooltip Element
			var tooltipEl = document.getElementById('linejs-tooltip');

			if (!tooltipEl) {
				tooltipEl = document.createElement('div');
				tooltipEl.id = 'linejs-tooltip';
				tooltipEl.innerHTML = "<table></table>"
				document.body.appendChild(tooltipEl);
			} else {
				tooltipEl.innerHTML = "<table></table>"
			}

			// Hide if no tooltip
			if (tooltip.opacity === 0) {
				tooltipEl.style.opacity = 0;
				return;
			}

			// Set caret Position
			tooltipEl.classList.remove('above', 'below', 'no-transform');
			if (tooltip.yAlign) {
				tooltipEl.classList.add(tooltip.yAlign);
			} else {
				tooltipEl.classList.add('no-transform');
			}

			function getBody(bodyItem) {
				return bodyItem.lines;
			}

			// Set Text
			if (tooltip.body) {
				var titleLines = tooltip.title || [];
				var bodyLines = tooltip.body.map(getBody);
			
				var innerHtml = '<thead>';

				titleLines.forEach(function(title) {
					//innerHtml += '<tr><th>' + title + '</th></tr>';
				});
				innerHtml += '</thead><tbody>';
	
				bodyLines.forEach(function(body, i) {
					var parts;
					var colors = tooltip.labelColors[i];

					parts = body[0];
        			parts = parts.split( ":" );
       				var newbody = '<span class="line-tool">' + parts[0].trim() + '</span> :  <span style="color:'+colors.backgroundColor+'">' + parts[1].trim() + '</span>';
       				        			
					
					var style = 'background:' + colors.backgroundColor;
					style += '; border-color:' + colors.borderColor;
					style += '; border-width: 2px'; 
					innerHtml += '<tr><td>' + newbody + '</td></tr>';
				});
				innerHtml += '</tbody>';

				var tableRoot = tooltipEl.querySelector('table');
				tableRoot.innerHTML = innerHtml;	
			}

			var position = this._chart.canvas.getBoundingClientRect();

			// Display, position, and set styles for font

			tooltipEl.style.opacity = 1;
			tooltipEl.style.left = tooltip.caretX +...