I have the following mysql table which obtained by following query(sel +ect * from tables); <code> | time | queue_name | description + | priority | jobs_pending | jobs_running | | 1490155563 | adice_long | ADICE Low-Priority/Long Runtime Job Q +ueue | 5 | 6 | 3 + + | 1490155563 | adice | ADICE +Low-Priority/Long Runtime Job Queue | 8 | 9 + | 3 + + + + + + | | 1490155563 | incisive | ADICE-Incisive Co-Simulation Queue + | 7 | 0 | | 1490155563 | vcs | ADICE High-Priority/Short Runtime Job + Queue | 10 | 0 | |
My query is i want to convert the above table into pie chart format . i should built two piechart one is for jobs pending and jobs running by matching it with queue name. If the queue name is available twice in the column we should calculate those two rows of jobs pending and jobs running and make them into single. code which i had tried are as follows:
print "var data_running=[[\"Adice \($TABLE_DATA{1}{'ENTRY'}\)\",$TABLE +_DATA{5}{'ENTRY'}],\ [\"Incisive \($TABLE_DATA{1}{'ENTRY'}\)\",$TABLE_ +DATA{5}{'ENTRY'}],\ [\"Vcs \($TABLE_DATA{1}{'ENTRY'}\)\",$TABLE_DATA{ +5}{'ENTRY'}], \n"; print "var data_pending=[[\"Adice \($TABLE_DATA{1}{'ENT +RY'}\)\",$TABLE_DATA{4}{'ENTRY'}],\ [\"Incisive \($TABLE_DATA{1}{'ENTRY'}\)\",$TABLE_ +DATA{4}{'ENTRY'}],\ [\"Vcs \($TABLE_DATA{1}{'ENTRY'}\)\",$TABLE_DATA{ +4}{'ENTRY'}],\n";
print " \n + pieChart(\"placeholder39\",data_running,{title:\"<b><center>Jobs Run +ning</center></b>\"});\n"; print " \n pieChart(\"placeholder41\",data_pending,{title:\"<b>< +center>Jobs Pending</center></b>\"});\n";
But am not sure am in right way to do it. |

In reply to How to calculate the column and print it in pie chart format using perl? by finddata

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.