JSFiddle - React, Tailwind, and code Playground

by larsenmtl

HTML

<script src="http://www.jqplot.com/deploy/dist/jquery.jqplot.min.js"></script>
<script src="http://www.jqplot.com/deploy/dist/plugins/jqplot.pieRenderer.min.js"></script>
<div id="chartdiv"></div>

JavaScript

plot1 = jQuery.jqplot ('chartdiv', [[10.1234,20,30]], 
{ 
  seriesDefaults: {
        // Make this a pie chart.
        renderer: jQuery.jqplot.PieRenderer, 
        rendererOptions: {
          // Put data labels on the pie slices.
          // By default, labels show the percentage of the slice.
          showDataLabels: true,
          dataLabels: 'value',
          dataLabelFormatString:'%.4f'
        }
  }, 
  legend: { show:true, location:'e'}
});



$('#chartdiv').bind('jqplotDataMouseOver', function (ev, seriesIndex, pointIndex, data) { alert('series: '+seriesIndex+', point: '+pointIndex+', data: '+data)});