Note that there are some explanatory texts on larger screens.

plurals
  1. PONeed help to write two javascript functions in flot jquery
    primarykey
    data
    text
    <p>EDIT*<strong><em>*</em>**</strong></p> <p>I want help with writing the two functions "plotSingleCoverage" and plotAllCoverage below. The major problem I have is that I don't know how to search through all existing datasets on the page and then write out a single array in a dataset, or all array's of the same sort in different datasets. So if anyone could push me in the right direction I would be more than happy =) </p> <p> Flot Examples </p> <pre><code> &lt;div id="placeholder" style="width:600px;height:300px;"&gt;&lt;/div&gt; &lt;p id="choices"&gt;Show:&lt;/p&gt; &lt;a href="javascript:plotSingleCoverage('Test1')"&gt;Show coverage of first test&lt;/a&gt; &lt;a href="javascript:plotAllCoverage()"&gt;Show coverage of all tests&lt;/a&gt; &lt;script type="text/javascript"&gt; $(function () { var Test1 = { "date": { label: "Date", data: [[1, 201], [2, 201], [3, 201], [4, 125]] }, "time": { label: "Time", data: [[1, 209], [2, 201], [3, 201], [4, 134]] }, "modules": { label: "Modules", data: [[1, 201], [2, 201], [3, 201], [4, 125]] }, "cases": { label: "Cases", data: [[1, 201], [2, 201], [3, 201], [4, 125]] }, "failed": { label: "Failed", data: [[1, 201], [2, 201], [3, 201], [4, 125]] }, "cover": { label: "Cover", data: [[1, 201], [2, 201], [3, 201], [4, 125]] } }; var Test2 = { "date": { label: "Date", data: [[1, 201], [2, 201], [3, 201], [4, 125]] }, "time": { label: "Time", data: [[1, 201], [2, 201], [3, 201], [4, 125]] }, "modules": { label: "Modules", data: [[1, 201], [2, 201], [3, 201], [4, 125]] }, "cases": { label: "Cases", data: [[1, 101], [2, 201], [3, 201], [4, 45]] }, "failed": { label: "Failed", data: [[1, 301], [2, 454], [3, 43], [4, 125]] }, "cover": { label: "Cover", data: [[1, 201], [2, 201], [3, 201], [4, 125]] } }; var Test3 = { "date": { label: "Date", data: [[1, 201], [2, 201], [3, 201], [4, 125]] }, "time": { label: "Time", data: [[1, 201], [2, 201], [3, 201], [4, 125]] }, "modules": { label: "Modules", data: [[1, 201], [2, 201], [3, 201], [4, 125]] }, "cases": { label: "Cases", data: [[1, 201], [2, 201], [3, 201], [4, 125]] }, "failed": { label: "Failed", data: [[1, 201], [2, 201], [3, 201], [4, 125]] }, "cover": { label: "errover", data: [[1, 201], [2, 201], [3, 201], [4, 125]] } }; /*Need help to write this function, it shall go to that dataset that its argument is, for example in this case it shall go to Test1 and read that cover and plot it in the #placeholder* function plotSingleCoverage(coverageToPlot){ $.plot($("#placeholder"), [???]); } /*This function shall simply go through all avaible datasets and plot all cover array's*/ function plotAllCoverage(){ $.plot($("#placeholder"), [???]); } }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Thanks in advance =)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload