E
E
easyterm2012-08-31 13:49:06
PHP
easyterm, 2012-08-31 13:49:06

How can I make a diagram from a ready-made piece of code?

There is a piece of code

<div class="dataTableFooter">
    <table>
      <tbody>
  <tr>
    <td class="pages">
      <span><?php echo Page::getLanguageString("Months:", "Monat:", "Месяц:"); ?></span>
<?php
  $y = NULL;
  for ($i = 0; $i < count($months); $i++) {
      if ($y === NULL || $y != $years[$i]) echo " <span>" . $years[$i] . ":</span>";
      $y = $years[$i];
      if ($y == $year && $months[$i] == $month)
    echo " <strong>" . $shortMonthName[$month] . "</strong>";
      else {
    echo " <a href=\"?lang=" . Page::getLanguage() . "&year=$y&m=" . $months[$i];
    if ($uid && $tid) echo "&uid=$uid&tid=$tid";
    else if ($uid) echo "&uid=$uid";
    else if ($tid) echo "&tid=$tid";
    else if ($cid) echo "&cid=$cid";
    else if ($coid) echo "&coid=$coid";
    else if ($rid) echo "&rid=$rid";
    echo "\">" . $shortMonthName[$months[$i]] . "</a>";
      }
  }
?>
    </td>
<?php $s = Page::getLanguageString("Total: ", "Summe: ", "Сумма: "); ?>
<?php $total = sprintf(Page::getLanguageString("%u.%02u", "%u.%02u", "%u,%02u"), floor($total / 100), $total % 100); ?>
    <td class="total"><?php echo $s; ?><strong><?php echo $total; ?></strong></td>
  </tr>
      </tbody>
    </table>
</div>

It produces a table with data
cf133bfe1aadb40488c56d03048cbe58.jpg
. Can this table be converted into a chart somehow?
6be93fcc0cf31af073ee16316d154eba.jpg
If someone wants to help for a fee, I'm ready to listen to suggestions in the PM.
Otherwise, I'm not strong in programming and have been struggling with this issue for a week now and there is no progress.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vampiro, 2012-08-31
@Vampiro

if ($uid && $tid) echo "&uid=$uid&tid=$tid"; 
else if ($uid) echo "&uid=$uid"; 
else if ($tid) echo "&tid=$tid"; 
else if ($cid) echo "&cid=$cid"; 
else if ($coid) echo "&coid=$coid"; 
else if ($rid) echo "&rid=$rid"

It looks like the work of the Indians from Odessa, honestly. I recommend refactoring this code in pieces: first bring it to the output “only numbers without signs”, then frame it with js tags to make a normal array, and then make diagrams from it. It seems like there are plenty of them on the net now. Can you see everyone? :)

E
easyterm, 2012-08-31
@easyterm

Thank you very much for your help! relic agreed to help me with the diagram.

S
softm, 2012-09-03
@softm

JS-of course it’s beautiful, but if the customer wants to save it, it will have to be in the picture. Therefore, it is better right away, in it. gd2 + php, nothing complicated, debugging will take time according to the size. And if JS, then there are “chips” in the text-jies / raphael.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question