title: Object function (e,t){return new x.fn.init(e,t,r)} has no method 'plot'
body: <p>I am successful in showing data graphically using flot charts API. I have built around 30 bar charts and now i am showing them all in one page and displaying the graph based on the value selected in the dropdown list. I am able to get the graphs individually but when all the graphs put together in one page , I am getting the above error i am not able to crack this.Please help me in this regard.</p>
  
  <pre><code>&lt;select id="zones" name="zones" onchange="getgraph()"&gt;
  &lt;option value="overall"&gt;Overall&lt;/option&gt;
  &lt;option value="sea"&gt;SEA&lt;/option&gt;
  &lt;option value="india"&gt;INDIA&lt;/option&gt;
  &lt;option value="nea"&gt;NEA&lt;/option&gt;
  &lt;option value="pz"&gt;PZ&lt;/option&gt;
  &lt;/select&gt;
  &lt;a onClick="change()" href="#"&gt;Click Here&lt;/a&gt;
  &lt;div id="one"&gt;
  &lt;?php include "barchart.php";?&gt;
  &lt;/div&gt;
  &lt;div id="two" style="display:none"&gt;
  &lt;?php include "barchart1.php";?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JavaScript</p>
  
  <pre><code>function change()
  {alert("hi");
      document.getElementById('two').style.display='block';
          document.getElementById('one').style.display='none';
  }
  </code></pre>
  
  <p>barchart.php</p>
  
  <pre><code>&lt;?php
  
      /* Your Database Name */
      $dbname = 'finalCMS';
  
      /* Your Database User Name and Passowrd */
      $username = 'root';
      $password = 'password1!';
  
      try {
        /* Establish the database connection */
        $conn = new PDO("mysql:host=localhost;dbname=$dbname", $username, $password);
        $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  
  
        $result = $conn-&gt;query("SELECT `EquipmentMainCatagory`,count(`EquipmentMainCatagory`) from asset a join assetinfo ai on a.assetid=ai.assetid and upper(ai.EquipmentStatus) like upper('%Active%') group by `EquipmentMainCatagory`");
  
  
  
  
        $rows = array();
  
          foreach($result as $r) {
  
  
           $rows[] = array( $r['EquipmentMainCatagory'],(int)$r['count(`EquipmentMainCatagory`)']); 
  
  
          }
  
      // convert data into JSON format
      $jsonTable = json_encode($rows);
  
          //print_r($jsonTable);
      } catch(PDOException $e) {
          echo 'ERROR: ' . $e-&gt;getMessage();
      }
      //mysql_close($conn);
  
       $conn=null;
  
      ?&gt;
  
  
  
  
  
  
  
  &lt;div id="placeholder" style="width:900px;height:450px;"&gt;&lt;/div&gt;
  
   &lt;script type="text/javascript"&gt;
          //******* 2012 Average Temperature - BAR CHART
          var data =&lt;?php echo $jsonTable;?&gt;;
          //alert(data);
  
  
  
  
  
  var ticks = [];
  for (var i = 0; i &lt; data.length; i++) {
      ticks.push([i,data[i][0]]);
      data[i][0] = i;   
  }
  //alert(ticks);
          //var data = [[0, 11],[1, 15],[2, 25],[3, 24],[4, 13],[5, 18]];
          var dataset = [{ data: data, color: "#5482FF" }];
          //var ticks = [[0, "London"], [1, "New York"], [2, "New Delhi"], [3, "Taipei"],[4, "Beijing"], [5, "Sydney"]];
  
          var options = {
              series: {
                  lineWidth: 5,
                  bars: {
                      show: true,
                      barWidth: 0.5,
                      align:"center"
                  }
              },
               xaxis: {
                  axisLabel: "EquipmentMainCatagory",
                  axisLabelUseCanvas: true,
                  axisLabelFontSizePixels: 12,
                  axisLabelFontFamily: 'Verdana, Arial',
                  axisLabelPadding: 10,
                  ticks: ticks,
                  //rotateTicks:90
                  labelAngle: 90
  
              },
              yaxis: {
                  axisLabel: "# Assets",
                  axisLabelUseCanvas: true,
                  axisLabelFontSizePixels: 12,
                  axisLabelFontFamily: 'Verdana, Arial',
                  axisLabelPadding: 3,
  
              },
  
              grid: {
                  hoverable: true,
                  borderWidth: 0,
                  backgroundColor: { colors: ["#ffffff", "#EDF5FF"] }
              }
          };
  
        //jQuery(document).ready(function() {
        function plot1(){
              $.plot($("#placeholder"), dataset, options);
              $("#placeholder").UseTooltip();
        }
  
  
             // });   
  
        var previousPoint = null, previousLabel = null;
  
          $.fn.UseTooltip = function () {
              $(this).bind("plothover", function (event, pos, item) {
                  if (item) {
                      if ((previousLabel != item.series.label) || (previousPoint != item.dataIndex)) {
                          previousPoint = item.dataIndex;
                          previousLabel = item.series.label;
                          $("#tooltip").remove();
  
                          var x = item.datapoint[0];
                          var y = item.datapoint[1];
  
                          var color = item.series.color;
  
                          //console.log(item.series.xaxis.ticks[x].label);               
  
                          showTooltip(item.pageX,
                          item.pageY,
                          color,
                        // "&lt;strong&gt;" + y + "&lt;/strong&gt;");
           item.series.xaxis.ticks[x].label + " : &lt;strong&gt;" + y + "&lt;/strong&gt;");
  
                      }
  
  
                  } else {
                      $("#tooltip").remove();
                      previousPoint = null;
                  }
              });
          };
  
          function showTooltip(x, y, color, contents) {
              $('&lt;div id="tooltip"&gt;' + contents + '&lt;/div&gt;').css({
                  position: 'absolute',
                  display: 'none',
                  top: y ,
                  left: x,
                  border: '2px solid ' + color,
                  padding: '3px',
                  'font-size': '9px',
                  'border-radius': '5px',
                  'background-color': '#fff',
                  'font-family': 'Verdana, Arial, Helvetica, Tahoma, sans-serif',
                  opacity: 0.9
              }).appendTo("body").fadeIn(200);
          }
      &lt;/script&gt;
  
  
  
  &lt;Script&gt;plot1()&lt;/Script&gt;
  </code></pre>
  
  <p>my javascript order</p>
  
  <pre><code>&lt;script src="assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
          &lt;script src="assets/plugins/jquery-ui/jquery-ui-1.10.1.custom.min.js" type="text/javascript"&gt;&lt;/script&gt;      
          &lt;script src="assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js" type="text/javascript" &gt;&lt;/script&gt;
          &lt;!--[if lt IE 9]&gt;
          &lt;script src="assets/plugins/excanvas.min.js"&gt;&lt;/script&gt;
          &lt;script src="assets/plugins/respond.min.js"&gt;&lt;/script&gt;  
          &lt;![endif]--&gt;   
          &lt;script src="assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="assets/plugins/jquery.blockui.min.js" type="text/javascript"&gt;&lt;/script&gt;  
          &lt;script src="assets/plugins/jquery.cookie.min.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript" &gt;&lt;/script&gt;
          &lt;!-- END CORE PLUGINS --&gt;
  
          &lt;!-- BEGIN PAGE LEVEL PLUGINS tree --&gt;
      &lt;script src="assets/plugins/bootstrap-tree/bootstrap-tree/js/bootstrap-tree.js"&gt;&lt;/script&gt;
      &lt;!-- END PAGE LEVEL PLUGINS --&gt;
      &lt;!-- BEGIN PAGE LEVEL SCRIPTS  tree--&gt;
      &lt;script src="assets/scripts/ui-tree.js"&gt;&lt;/script&gt;     
      &lt;!-- END PAGE LEVEL SCRIPTS --&gt;
  
      &lt;!-- BEGIN PAGE LEVEL PLUGINS view assets --&gt;
      &lt;script type="text/javascript" src="assets/plugins/select2/select2.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="assets/plugins/data-tables/jquery.dataTables.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="assets/plugins/data-tables/DT_bootstrap.js"&gt;&lt;/script&gt;
      &lt;!-- END PAGE LEVEL PLUGINS --&gt;
  
     &lt;!-- page level plugins for edit page--&gt;
      &lt;script type="text/javascript" src="assets/plugins/bootstrap-wysihtml5/wysihtml5-0.3.0.js"&gt;&lt;/script&gt; 
  
      &lt;script type="text/javascript" src="assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="assets/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="assets/plugins/moment.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="assets/plugins/jquery.mockjax.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="assets/plugins/bootstrap-editable/bootstrap-editable/js/bootstrap-editable.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="assets/plugins/bootstrap-editable/inputs-ext/address/address.js"&gt;&lt;/script&gt;
  
       &lt;!-- just --&gt;
          &lt;script type="text/javascript" src="assets/plugins/ckeditor/ckeditor.js"&gt;&lt;/script&gt;  
      &lt;script type="text/javascript" src="assets/plugins/bootstrap-fileupload/bootstrap-fileupload.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="assets/plugins/chosen-bootstrap/chosen/chosen.jquery.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="assets/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="assets/plugins/bootstrap-toggle-buttons/static/js/jquery.toggle.buttons.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="assets/plugins/clockface/js/clockface.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="assets/plugins/bootstrap-daterangepicker/date.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="assets/plugins/bootstrap-daterangepicker/daterangepicker.js"&gt;&lt;/script&gt; 
      &lt;script type="text/javascript" src="assets/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.js"&gt;&lt;/script&gt;  
      &lt;script type="text/javascript" src="assets/plugins/bootstrap-timepicker/js/bootstrap-timepicker.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="assets/plugins/jquery-inputmask/jquery.inputmask.bundle.min.js"&gt;&lt;/script&gt;   
      &lt;script type="text/javascript" src="assets/plugins/jquery.input-ip-address-control-1.0.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="assets/plugins/jquery-multi-select/js/jquery.multi-select.js"&gt;&lt;/script&gt;   
      &lt;script src="assets/plugins/bootstrap-modal/js/bootstrap-modal.js" type="text/javascript" &gt;&lt;/script&gt;
      &lt;script src="assets/plugins/bootstrap-modal/js/bootstrap-modalmanager.js" type="text/javascript" &gt;&lt;/script&gt; 
      &lt;script src="assets/plugins/jquery.pwstrength.bootstrap/src/pwstrength.js" type="text/javascript" &gt;&lt;/script&gt;
      &lt;script src="assets/plugins/bootstrap-switch/static/js/bootstrap-switch.js" type="text/javascript" &gt;&lt;/script&gt;
      &lt;script src="assets/plugins/jquery-tags-input/jquery.tagsinput.min.js" type="text/javascript" &gt;&lt;/script&gt;
      &lt;!--page level plugin for edit page ends here--&gt;
  
          &lt;script src="assets/scripts/app.js"&gt;&lt;/script&gt;  
          &lt;script src="js/index_js.js"&gt;&lt;/script&gt; 
          &lt;!-- for notifications --&gt;
           &lt;script src="js/ournotification.js"&gt;&lt;/script&gt; 
         &lt;!-- &lt;script src="js/filterdashboard.js"&gt;&lt;/script&gt;--&gt;
          &lt;script src="js/viewpage_js.js"&gt;&lt;/script&gt; 
           &lt;script src="js/allvalidate.js"&gt;&lt;/script&gt;
           &lt;script src="js/uprofile.js"&gt;&lt;/script&gt;
           &lt;script src="js/custom.js"&gt;&lt;/script&gt;
           &lt;!--&lt;script src="js/rightclick.js"&gt;&lt;/script&gt;
           &lt;script src="js/f12.js"&gt;&lt;/script&gt;--&gt;
            &lt;!-- for jqplot graphs --&gt;
  
            &lt;!--&lt;script src="js/jqplot.js"&gt; &lt;/script&gt;
             &lt;script src="assets/plugins/jqplot.pieRenderer.min.js"&gt;&lt;/script&gt;
              &lt;link rel="stylesheet" type="text/css" href="css/graphs.css"&gt;--&gt;
              &lt;!-- end of jqplot graphs js --&gt;
         &lt;!--  &lt;script src="js/filter_assets.js"&gt;&lt;/script&gt;--&gt;
          &lt;!--&lt;script src="js/filter_view.js"&gt;&lt;/script&gt;--&gt; 
          &lt;script src="assets/plugins/bootstrap-tag/js/bootstrap-tag.js" type="text/javascript" &gt;&lt;/script&gt; 
      &lt;script src="assets/plugins/fancybox/source/jquery.fancybox.pack.js" type="text/javascript" &gt;&lt;/script&gt;
      &lt;script src="assets/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.js" type="text/javascript" &gt;&lt;/script&gt;
      &lt;!-- BEGIN:File Upload Plugin JS files--&gt;
      &lt;script src="assets/plugins/jquery-file-upload/js/vendor/jquery.ui.widget.js"&gt;&lt;/script&gt;
      &lt;!-- The Templates plugin is included to render the upload/download listings --&gt;
      &lt;script src="assets/plugins/jquery-file-upload/js/vendor/tmpl.min.js"&gt;&lt;/script&gt;
      &lt;!-- The Load Image plugin is included for the preview images and image resizing functionality --&gt;
      &lt;script src="assets/plugins/jquery-file-upload/js/vendor/load-image.min.js"&gt;&lt;/script&gt;
      &lt;!-- The Canvas to Blob plugin is included for image resizing functionality --&gt;
      &lt;script src="assets/plugins/jquery-file-upload/js/vendor/canvas-to-blob.min.js"&gt;&lt;/script&gt;
      &lt;!-- The Iframe Transport is required for browsers without support for XHR file uploads --&gt;
      &lt;script src="assets/plugins/jquery-file-upload/js/jquery.iframe-transport.js"&gt;&lt;/script&gt;
      &lt;!-- The basic File Upload plugin --&gt;
      &lt;script src="assets/plugins/jquery-file-upload/js/jquery.fileupload.js"&gt;&lt;/script&gt;
      &lt;!-- The File Upload file processing plugin --&gt;
      &lt;script src="assets/plugins/jquery-file-upload/js/jquery.fileupload-fp.js"&gt;&lt;/script&gt;
      &lt;!-- The File Upload user interface plugin --&gt;
      &lt;script src="assets/plugins/jquery-file-upload/js/jquery.fileupload-ui.js"&gt;&lt;/script&gt;
      &lt;!-- The XDomainRequest Transport is included for cross-domain file deletion for IE8+ --&gt;
      &lt;!--[if gte IE 8]&gt;&lt;script src="assets/plugins/jquery-file-upload/js/cors/jquery.xdr-transport.js"&gt;&lt;/script&gt;&lt;![endif]--&gt;
      &lt;!-- END:File Upload Plugin JS files--&gt;
      &lt;!-- END PAGE LEVEL PLUGINS --&gt;
  
          &lt;script src="assets/scripts/inbox.js"&gt;&lt;/script&gt;  
          &lt;script src="assets/scripts/table-managed.js"&gt;&lt;/script&gt;
          &lt;script src="assets/scripts/form-components.js"&gt;&lt;/script&gt;
          &lt;script src="assets/scripts/jquery.colorbox.js"&gt;&lt;/script&gt; 
          &lt;script src="js/inbox_related.js"&gt;&lt;/script&gt; 
  
          &lt;script src="js/jquery.mCustomScrollbar.concat.min.js"&gt;&lt;/script&gt;    
  &lt;script type="text/javascript"  src="assets/plugins/flot/jquery.flot.js"&gt;&lt;/script&gt;
  &lt;script src="assets/plugins/flot/jquery.flot.time.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" language="javascript" src="assets/plugins/flot/jquery.flot.axislabels.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" language="javascript" src="assets/plugins/flot/jquery.flot.orderBars.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" language="javascript" src="assets/plugins/flot/jquery.flot.tickrotatotor.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" language="javascript" src="assets/plugins/flot/jquery.flot.axislabels.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" language="javascript" src="assets/plugins/flot/jquery.flot.labelangle.min.js"&gt;&lt;/script&gt; 
  </code></pre>