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 - JavaScript Tutorial
From the course: Code Clinic: JavaScript
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
(Locked)
Intro: The weather at Pond Oreille1m 51s
-
(Locked)
Solution overview2m 20s
-
(Locked)
Accessing the MySQL database7m 13s
-
Reading data with fetch()4m 17s
-
(Locked)
Passing information to our database2m 56s
-
(Locked)
Charting basic data with C3.js5m 42s
-
(Locked)
Plotting multiple graphs9m 28s
-
(Locked)
Customizing the chart display4m 32s
-
(Locked)
Controlling the interface9m 30s
-
(Locked)
-
-
-
-
-