From the course: Code Clinic: JavaScript

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Customizing the chart display

Customizing the chart display - JavaScript Tutorial

From the course: Code Clinic: JavaScript

Start my 1-month free trial

Customizing the chart display

[Instructor] C3 uses a JavaScript object, which is represented right here. Now we can add additional fields to this to control how that data is displayed. So for example, we can modify the type of data that we are seeing by adding a type parameter. So let's go ahead and type in here, type, and then use something called scatter to show a scatter plot. So you can see that this is just a series of dots, and right now it's graphing the dots for the barometric pressure, as well as our coefficient, and that's cool, but sometimes you do want these types to be different. So what you can do is specify another parameter called types, and this will get another object. And then in here, you can specify each of the different fields in how they will plot. You can say that the barometric pressure is a scatter plot, and then you can use any of the other ones. So for example here, we want to do our coefficient, and the type here will be line. Make sure we put a comma right here. And now you can see if…

Contents