I have a QCustomPlot with multiple graph items on it.
I wish to toggle their visibility by clicking on the relevant item in the legend.
QObject::connect(
plot,
&QCustomPlot::legendClick,
[](QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
{
// how to get to the relevant graph from the item variable?
}
);
Thank you.