JSFiddle - React, Tailwind, and code Playground

by FGRibreau

HTML

<form action='https://image-charts.com/chart' method='POST' id='post_form'>
  <input type='hidden' name='cht' value='lc' />
  <input type='hidden' name='chtt' value='This is my chart' />
  <input type='hidden' name='chs' value='300x200' />
  <input type='hidden' name='chxt' value='x' />
  <input type='hidden' name='chd' value='t:40,20,50,20,100' />
  <input type='submit' />
</form>

JavaScript

// Send the POST when the page is loaded,
// which will replace this whole page with the retrieved chart.
var frm = document.getElementById('post_form');
if (frm) {
  frm.submit();
}