I have a short code in wordpress that looks like this
[wp_charts title="linechart" type="line" align="alignleft" margin="5px 20px" datasets="20,25,10,10,10,10,10,105,59,34,23,21,54,12,22,34,54,21,22,12,3,4,7,8,4,6,2,9" labels="25th,26th,27th,28th,29th,30th,31st,1st,2nd,3rd,4th,5th,6th,7th,8th,9th,10th,11th,12th,13th,14th,15th,16th,17th,18th,19th,20th,21st,22nd,23rd,24th" scaleoverride="true" scalesteps="8" scalestepwidth="10" scalestartvalue="0" scaleFontSize="16" canvaswidth="920px" canvasheight="460px" relativewidth="2" width="920px" height="460px" backgroundcolor="#000"]
and i need to collect the "datasets" as an array then add them and echo the total number but im not sure how. I know how to get an element by id but not how to get just that part of the short code.. any help would be appreciated
As a side note im using phpexec in word press to run php from within a post so if there is a method using php it would be best.
Update the $array is the thing that i need to populate with datasets
<p style="text-align: center;"><strong><span style="font-size: 14pt;">MILES WALKED BY DAY<br>
TOTAL MILES SO FAR
<?php
$array = array(**this is the area i need to populate with datasets**);
$mystr = array_sum($array);
echo $mystr;
?>
</span>
</strong>
</p>
[wp_charts title="linechart" id="chart" type="line" align="alignleft" margin="5px 20px"
datasets="20,25,10,10,10,10,10,22,59,34,23,21,54,12,22,34,54,21,22,12,3,4,7,8,4,6,2,9"
labels="25th,26th,27th,28th,29th,30th,31st,1st,2nd,3rd,4th,5th,6th,7th,8th,9th,10th,11th,
12th,13th,14th,15th,16th,17th,18th,19th,20th,21st,22nd,23rd,24th" sumdatasets=''
scaleoverride="true" scalesteps="10" scalestepwidth="5" scalestartvalue="0"
scaleFontSize="16" canvaswidth="920px" canvasheight="460px" relativewidth="2"
width="920px" height="460px" backgroundcolor="#000"]