Chris Leonello avatar Chris Leonello committed 6587943

Fixed example.

Comments (0)

Files changed (1)

examples/blockPlot.php

     var s3 = [[1, 59, 'Coca-Cola', {background:'rgb(250, 160, 160)'}], [2, 50, 'Ambasa'], 
     [3, 90, 'Mello Yello'], [4, 90, 'Sprite'], [5, 71, 'Squirt'], [5, 155, 'Youki']];
 
-    var plot1 = $.jqplot('chart1',[s1, s2, s3],{
+    $('#chart1').jqplot([s1, s2, s3],{
         seriesDefaults:{
             renderer:$.jqplot.BlockRenderer
         }, 
         }
     });
 });
+ 
+ function move(dir, val) {
+     var plot1 = $('#chart1').data('jqplot');
+     val = parseFloat(val);
+     var sidx = parseInt($('#seriesId').val());
+     var pidx = parseInt($('#pointId').val());
+     var duration = $('#duration').val();
+     var x = plot1.series[sidx].data[pidx][0];
+     var y = plot1.series[sidx].data[pidx][1];
+     (dir == 'x') ? x += val : y += val; 
+     plot1.series[sidx].moveBlock(pidx, x, y, duration);
+ }
+ 
 </script>
 
 <script class="code" type="text/javascript">
    
  });
  
- function move(dir, val) {
-     val = parseFloat(val);
-     var sidx = parseInt($('#seriesId').val());
-     var pidx = parseInt($('#pointId').val());
-     var duration = $('#duration').val();
-     var x = plot1.series[sidx].data[pidx][0];
-     var y = plot1.series[sidx].data[pidx][1];
-     (dir == 'x') ? x += val : y += val; 
-     plot1.series[sidx].moveBlock(pidx, x, y, duration);
- }
- 
 </script>
 
 <!-- End example scripts -->
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.