Notice how the class
for each layer is set here. This allows the example
to determine how these individual layers appear with an efficient stylesheet and avoid
DOM manipulation. It also allows for dynamically updating the styles, such as when
hovering over the cooresponding legend item.
new c3.Plot.Layer.Line<CrossFilter.Grouping<number, number>>({
options: {
title: "% Services",
class: 'services',
},
data: services_by_year_data,
}),
new c3.Plot.Layer.Line<CrossFilter.Grouping<number, number>>({
options: {
title: "% Manufacturing",
class: 'manufacturing',
},
data: manufacturing_by_year_data,
}),
new c3.Plot.Layer.Line<CrossFilter.Grouping<number, number>>({
options: {
title: "% Agriculture",
class: 'agriculture',
},
data: agriculture_by_year_data,
}),