So I have a graph with multiple series.
.Series(series => {
series.Line(model => model.SentFiles).Name("Sent");
series.Line(model => model.ReceivedFiles).Name("Received");
series.Column(model => model.SentFiles).Name("Sent Data");
series.Column(model => model.ReceivedFiles).Name("Received Data");
series.Area(model => model.ReceivedFiles).Name("Received Data").Labels(false);
series.Area(model => model.SentFiles).Name("Sent Data").Labels(false);
})
because I want my users to be able to show and hide multiple different types of data in 1 graph
I have worked out how to hide series
for (var i = 0, length = series.length; i < length; i++) {
series[i].stack = stack;
series[i].visible = (types.indexOf(series[i].type) != -1);
};
however the legend for the series just "grays out".
I want to be able to show and hide the legend as I show and hide the series.
can you please advise how I can achieve this.
Thanks
*** EDIT ***
Ok so my initial problem was hiding the legends dynamically, this has been solved.
However, I now have the issue of setting the initial setup of the series and legends...
So I can do the following
.Series(series =>
{
series.Line(model => model.SentFiles).Name("Sent");
series.Line(model => model.ReceivedFiles).Name("Received");
series.Column(model => model.SentFiles).Name("Sent Data").Visible(false);
series.Column(model => model.ReceivedFiles).Name("Received Data").Visible(false);
series.Area(model => model.ReceivedFiles).Name("Received Data").Visible(false);
series.Area(model => model.SentFiles).Name("Sent Data").Visible(false);
})
which will hide the series, but the legends for those are viewable ("grayed out"). I want a way to initially hide the legends.
I would prefer not having to call a js method on Document.Ready to then hide series
I would have thought if this functionality is available through the JS api that this should be a configurable setting.
Thanks in advance
.Series(series => {
series.Line(model => model.SentFiles).Name("Sent");
series.Line(model => model.ReceivedFiles).Name("Received");
series.Column(model => model.SentFiles).Name("Sent Data");
series.Column(model => model.ReceivedFiles).Name("Received Data");
series.Area(model => model.ReceivedFiles).Name("Received Data").Labels(false);
series.Area(model => model.SentFiles).Name("Sent Data").Labels(false);
})
because I want my users to be able to show and hide multiple different types of data in 1 graph
I have worked out how to hide series
for (var i = 0, length = series.length; i < length; i++) {
series[i].stack = stack;
series[i].visible = (types.indexOf(series[i].type) != -1);
};
however the legend for the series just "grays out".
I want to be able to show and hide the legend as I show and hide the series.
can you please advise how I can achieve this.
Thanks
*** EDIT ***
Ok so my initial problem was hiding the legends dynamically, this has been solved.
However, I now have the issue of setting the initial setup of the series and legends...
So I can do the following
.Series(series =>
{
series.Line(model => model.SentFiles).Name("Sent");
series.Line(model => model.ReceivedFiles).Name("Received");
series.Column(model => model.SentFiles).Name("Sent Data").Visible(false);
series.Column(model => model.ReceivedFiles).Name("Received Data").Visible(false);
series.Area(model => model.ReceivedFiles).Name("Received Data").Visible(false);
series.Area(model => model.SentFiles).Name("Sent Data").Visible(false);
})
which will hide the series, but the legends for those are viewable ("grayed out"). I want a way to initially hide the legends.
I would prefer not having to call a js method on Document.Ready to then hide series
I would have thought if this functionality is available through the JS api that this should be a configurable setting.
Thanks in advance