Now for example, If in first time button press, 10 lines was draw. and in second click if only 2 lines draw, in that case, i am also see previous 8 lines , but i dont want.
So if in these case i am able to remove all previous 10 lines and able to add new 2 lines that will be better. Is there any existing option please let me know or please enhance this feature in dc.js.
Thanks
To clarify, is your question how to remove child charts from a composite chart?
Although there isn't a way to do exactly that, you can replace the children by calling the compose method with the new set of children, and removing the graphical elements using child.g().remove()
You can see this technique at work in the series chart:
https://github.com/dc-js/dc.js/blob/master/src/series-chart.js#L82-90
I did not get what is "c" here.
Also my way to add chart in to composite chart is like this:
mainChart.compose(getChartArrFromSpider(flyingChart));
where flying chart is my line chart.
You would have to look at the rest of the series chart code to understand the c. I was only linking to it as an example of the technique, which is to both to compose the child charts you want to keep, and also manually remove the g elements of the charts you are removing.
It is not ideal, and I agree it would be better for the composite chart to support removing directly, just trying to point you to a workaround for the time being.