Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C3.js - Show/hide points independently for a data series

I am creating a line chart for a data series using C3.js.

I am struggling in trying to show the "points" only for one of the series.

Basically, first I am creating a multiple series line chart with some reference data, and then I am loading (with char.load) a new particular data line in which I want to show points, only for that particular line while the other reference lines remain with hidden points.

Is that possible via C3.js? If so, could you instruct me to do so, thanks! Also, any method to do so using D3.js while using C3.js is welcome.

This is the official example in which all points are hidden for a data series, just for reference: http://c3js.org/samples/point_show.html

like image 726
VicM Avatar asked Nov 25 '14 00:11

VicM


1 Answers

c3.js provides comprehensive class attributes on all its elements so you can customize them with CSS. For example to hide the points on the 2nd series add this CSS:

#chart .c3-circles-data2 {
  display: none;
}

Example here.

like image 144
Mark Avatar answered Nov 06 '22 23:11

Mark