How to show only clicking legend data in c3js chart?
<p>I have a line chart with multiple data. Here is the sample of my chart.</p>

<p><a href="https://i.stack.imgur.com/EDfJr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EDfJr.png" alt="legend"></a></p>

<p>Normally legend data are automatically show/hide if I click that legend on chart.</p>

<p>But after I adding a function in legend like this,</p>

<pre><code>legend: {
        position: 'right',
        item: {
                onclick: function (d) { 
                            console.log("onclick", d); 
                            show(d); //when I click legend show some data
                }
            }
},
</code></pre>

<p>I don't get automatically show/hide if I click that legend on chart. But its not important for me.</p>

<p>Instead of this, I want to show only clicking legend data in chart. if I click <code>data1</code> legend, I want to show only <code>data1</code> line in chart and hide another <code>data2</code>,<code>data3</code> and <code>data4</code> line in chart.</p>

<p>But, I don't have any idea how to do this. I'm very appreciate for any suggestion.</p>