Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c3.js how to remove line with tooltip?

Tags:

c3.js

I am creating a line chart using c3.js. I want to remove the default indicator line to x-axis with the tooltip.

I have tried tooltip formatting but the line remains same.

How this can be done?

like image 800
Anup Raj Avatar asked Jun 30 '15 07:06

Anup Raj


2 Answers

grid:{
  focus:{
    show:false
  }
}   

May be at that time when person answer this question config parameter not provided but now you can do it through above mention configuration. Reference http://c3js.org/reference.html#grid-focus-show

Example code below

var chart = c3.generate({
    data: {
        columns: [
            ['data1', 30, 200, 100, 400, 150, 250],
            ['data2', 50, 20, 10, 40, 15, 25]
        ]
    },
    grid:{
        focus:{
        show:false
      }
    }
});
like image 101
Syed Raza Avatar answered Jan 03 '23 19:01

Syed Raza


Just override the following css property in .c3-xgrid-focus class:-

.c3-grid .c3-xgrid-focus { visibility : hidden !important; }

I could not quickly find a config parameter to turn this feature off in the api doc.

enter image description here

like image 45
Chetan Avatar answered Jan 03 '23 20:01

Chetan