Area Chart
An area chart is derived from a line chart, by marking the area between the X axis and the line plot. It is usually used to compare the areas under the curve for two or more different plots.
lineOptions: {
regionFill: 1 // default: 0
},
Plotting Trends
Line charts are great to show trends. One of the reasons they are interesting is because the data involved usually involves a large number of data points. For so many points, we'd really like to keep the plot as less detailed as we can, while also using the already present color to advantage. Let's see how we can change some properties of a default line chart can reduce clutter.
Continuity
The X axis (often the time axis) is usually continuous. That means we can reduce the redundancy of rendering every X label by allowing for only a few periodic ones.
We can skip X labels by setting the xIsSeries
property in axisOptions
to true
.
axisOptions: {
xIsSeries: true // default: false
},
This results only some of the X ticks having a label.
The line plot in the above plot could still be simplified. For example, to maintain uniformity, we could opt out of showing the dots at all, with hideDots
.
lineOptions: {
hideDots: 1 // default: 0
},
Or you could just choose to show only the dots instead.
lineOptions: {
hideLine: 1 // default: 0
},
A subtle way to show gradation of values is to render a change in color with the magnitude of the values. The property that does this is called heatline
.
lineOptions: {
heatline: 1 // default: 0
},
When showing certain data where a linear slope between two data points is not suitable, you can use the spline
property.
lineOptions: {
spline: 1 // default: 0
},
Combinations
Here's a demo using different combinations of the line options.
Next up, we'll start to annotate the data in charts.