Commit 23cdb299 authored by David Schnur's avatar David Schnur

Merge pull request #21 from reustle/master

Prevent single slice pie charts on example page
parents eafe69a4 98ca809a
...@@ -10,27 +10,30 @@ ...@@ -10,27 +10,30 @@
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
// data /*
/*var data = [ // Example Data
var data = [
{ label: "Series1", data: 10}, { label: "Series1", data: 10},
{ label: "Series2", data: 30}, { label: "Series2", data: 30},
{ label: "Series3", data: 90}, { label: "Series3", data: 90},
{ label: "Series4", data: 70}, { label: "Series4", data: 70},
{ label: "Series5", data: 80}, { label: "Series5", data: 80},
{ label: "Series6", data: 110} { label: "Series6", data: 110}
];*/ ];
/*var data = [ var data = [
{ label: "Series1", data: [[1,10]]}, { label: "Series1", data: [[1,10]]},
{ label: "Series2", data: [[1,30]]}, { label: "Series2", data: [[1,30]]},
{ label: "Series3", data: [[1,90]]}, { label: "Series3", data: [[1,90]]},
{ label: "Series4", data: [[1,70]]}, { label: "Series4", data: [[1,70]]},
{ label: "Series5", data: [[1,80]]}, { label: "Series5", data: [[1,80]]},
{ label: "Series6", data: [[1,0]]} { label: "Series6", data: [[1,0]]}
];*/ ];
*/
// Randomly Generated Data
var data = []; var data = [];
var series = Math.floor(Math.random()*10)+1; var series = Math.floor(Math.random()*6)+3;
for( var i = 0; i<series; i++) for( var i = 0; i<series; i++){
{
data[i] = { label: "Series"+(i+1), data: Math.floor(Math.random()*100)+1 } data[i] = { label: "Series"+(i+1), data: Math.floor(Math.random()*100)+1 }
} }
...@@ -512,7 +515,6 @@ $.plot($("#graph5"), data, <br/> ...@@ -512,7 +515,6 @@ $.plot($("#graph5"), data, <br/>
<div id="graph6" class="graph"></div> <div id="graph6" class="graph"></div>
<label for="graph6"> <label for="graph6">
Labels can be hidden if the slice is less than a given percentage of the pie (10% in this case). Labels can be hidden if the slice is less than a given percentage of the pie (10% in this case).
<br><span style="color: red">Note: you may need to refresh the page to see this effect.</span>
<code> <code>
$.plot($("#graph6"), data, <br/> $.plot($("#graph6"), data, <br/>
{<br/> {<br/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment