O'Reilly logo

Learning jqPlot by Scott Gottreu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a scatterplot chart

Now that we have created our new function file, we are ready to begin building our chart. A scatterplot chart is rendered the same in jqPlot as a normal line chart except that we turn off the lines connecting our data points.

  1. We start our code by including the trend line plugin and our new functions.js file. We create a new data conversion function called dataConversion. Since remoteDataCallback is passing back an array, we simply need to wrap it in another array for jqPlot:
    <script src="../js/jqplot.trendline.min.js"></script>
    <script src="../js/functions.js"></script>
    <script>
    function dataConversion(remoteData) {
      var data = new Array();
      data[0] = remoteData;
      return data;
    }
  2. We create our chart object and pass in the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required