Skip to content

Instantly share code, notes, and snippets.

@shane-reaume
Created February 21, 2013 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shane-reaume/5001095 to your computer and use it in GitHub Desktop.
Save shane-reaume/5001095 to your computer and use it in GitHub Desktop.
JSCharts, improve label and tooltip values for larger data with PHP
<?php
$e1 = 1;
$e2 = $e1;
$e3 = --$e2;
while ($e1 <= $counting) {
echo "myChart.setLabelX([".$e1.",'".$e1++."']);";
}
while( $e2 <= $counting ) {
$value = $teststring[$e3++];
$value2 = $value[$e2];
echo "myChart.setTooltip([".$e2++.",'".$value2."']);";
}
?>
/* myChart.setLabelX([10,'LAST INPUT']); --old way--
myChart.setLabelX([9, '9']);
myChart.setLabelX([8,'8']);
myChart.setLabelX([7,'7']);
myChart.setLabelX([6,'6']);
myChart.setLabelX([5,'5']);
myChart.setLabelX([4,'4']);
myChart.setLabelX([3,'3']);
myChart.setLabelX([2,'2']);
myChart.setLabelX([1,'1']); */
/*myChart.setTooltip([1,'']); --old way--
myChart.setTooltip([2,'']);
myChart.setTooltip([3,'']);
myChart.setTooltip([4,'']);
myChart.setTooltip([5,'']);
myChart.setTooltip([6,'']);
myChart.setTooltip([7,'']);
myChart.setTooltip([8,'']);
myChart.setTooltip([9,'']);
myChart.setTooltip([10,'']);*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment