One simple solution is to use the CSS display property for svg chart elements such as: -
http://jsfiddle.net/chetanbh/j9vx0dmg/
var chart = c3.generate({
data: {
columns: [
['data1', 100, 200, 150, 300, 200],
['data2', 400, 500, 250, 700, 300],
]
}
});
In the c3js chart example above, the line chart is displayed with two lines.
Each line represents the svg element of the path under the Group element. These group members will receive class attribute values, such as "c3-target-data1" and "c3-target-data2".
Using this, we can use CSS as: -
.c3-target-data2 {
display: none;
}
to hide the whole "data2" in the chart, but the tooltip will continue to show the data for "data2".

Hope this helps.
source
share