JSFiddle - React, Tailwind, and code Playground

by dkamburov

HTML

<script src="https://igniteui.com/js/modernizr.min.js"></script>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
<script src="https://cdn-na.infragistics.com/igniteui/latest/js/infragistics.core.js"></script>
<script src="https://cdn-na.infragistics.com/igniteui/latest/js/infragistics.dv.js"></script>
<script src="https://igniteui.com/js-data/temperature"></script>
<link href="https://cdn-na.infragistics.com/igniteui/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet"></link>
<link href="https://cdn-na.infragistics.com/igniteui/latest/css/structure/infragistics.css" rel="stylesheet"></link>
<link href="https://cdn-na.infragistics.com/igniteui/latest/css/structure/modules/infragistics.ui.chart.css" rel="stylesheet"></link>

<div>
        <h2>New York City vs. Philadelphia</h2>
        <div class="chartContainer">
            <div class="chart" id="chartLine"></div>
            <div class="chart" id="chartPie"></div>
            <div class="chart" id="chartArea"></div>
            <div class="chart" id="chartColumn"></div>
        </div>
        <div class="legend" id="legend"></div> 
        <div>
            <div>
                Weather data from:<br />
                <a href="http://www.noaa.gov/" target="_blank">NOAA</a>
            </div>
        </div>  
    </div>

CSS

h2
        {
            width: 100%;
            text-align: center;
        }
        
        .chart
        {
            display: inline-block; 
        }
        .legend
        {
            display: inline-block; 
        }

JavaScript

$(function () {
            function CreateChart(selector, seriesType, title, hasLegend) {
                var thickness = 3;
                var markerType = "none";
                if (seriesType == "radialColumn" || seriesType == "radialPie") {
                    thickness = 1;
                }

                if (seriesType == "radialLine" || seriesType == "radialArea") {
                    markerType = "circle";
                }

                $(selector).igDataChart({
                    width: "250px",
                    height: "250px",
                    circleMarkerTemplate: {
                      measure: function(measureInfo) {
                          measureInfo.context;    // either a DOM element or a CanvasContext2D depending on the particular template scenario
                          measureInfo.width;      // if value is present, specifies the available width, user may set to desired width for content
                          measureInfo.height;     // if value is present, specifies the available height, user may set to desired height for content
                          measureInfo.isConstant; // user should set to true if desired with and height will always be the same for this template
                          measureInfo.data;       // if present, represents the contextual data for this template]
                      },
                      render: function (renderInfo) {
                          renderInfo.context;            //    either a DOM element or a CanvasContext2D depending on the particular template scenario
                          renderInfo.xPosition;          //    if present, specifies the x position at which to render the content
                          renderInfo.yPosition;          //    if present, specifies the y position at which to render the content
                          renderInfo.availableWidth;     //    if present, specifies the available width in which to render the content
             ...