From the course: DC.js for Data Science Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Working with dates to make a line or area chart

Working with dates to make a line or area chart - JavaScript Tutorial

From the course: DC.js for Data Science Essential Training

Working with dates to make a line or area chart

- [Instructor] Now we're going to make an area chart using time series data. So you can save the barChart file as lineChart, so that we effectively make a copy and we can change title to Line chart, and the heading can be Line chart: total payment over time, like so. We can leave the html structure which is just a single div, as it is, and we can leave the id name as chart, that's fine as well. And for now even, we're going to work with the same data. So to begin with, all we're going to do is change dc.barChart to dc.lineChart, and then we're going to navigate to our new page, and refresh. Now we can see the power of dc by changing one little thing, immediately we have a line chart using all of the same parameters that we used before. Many parameters are common to all charts like this, but this isn't the best example of a line chart because it's bucketed data, and you'd normally use a bar chart to show that kind of data, so let's go for something more normal and head for a time…

Contents