O'Reilly logo

Beginning JavaScript Charts: With jqPlot, d3, and Highcharts by Fabio Nelli

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

CHAPTER 4

image

Drawing a Line Chart

In the previous chapter, you built an HTML table as a sample of structured data and developed parsers in JavaScript to extract the data into arrays. In this chapter, you will build a line chart with JavaScript as one of the possible visualizations for the data in the table from Chapter 3.

Before you start to convert the data into graphic elements to achieve your line chart, you need a place in which to use it. Therefore, I will begin this chapter by introducing the canvas. You will see what this is and how to implement it, and, in the end, you will integrate it into your web page.

Once you understand what the canvas ...

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