I searched a lot for change the visibility of a line in series by toggle button near in legend or somewhere else but reached nothing special.
It's igDataChart with real-time data of two or more fields and it's hard to see which value is related to the fields because most of data has the same value at the same time. To fix this issue I wanna hide one or more fields in series.
Is there any suggestion?
Have a look at "Configurable Visual Elements" topic here.
You can use the provided online sample in order to change the visibility of elements like, series, markers, axis lines etc.
$("#priceSeries").click(function () {
var posBrush = ($(this).is(":checked")) ? priceSeriesPositiveBrush : transperantBrush;
var negBrush = ($(this).is(":checked")) ? priceSeriesNegativeBrush : transperantBrush;
var outlineBrush = ($(this).is(":checked")) ? priceSeriesOutline : transperantBrush;
var visibility = ($(this).is(":checked")) ? "visible" : "collapsed";
$("#chart").igDataChart("option", "series", [
{
name: "priceSeries",
brush: posBrush, negativeBrush: negBrush, outline: outlineBrush,
legendItemVisibility: visibility
}]);
$("#chart").igDataChart("styleUpdated");
});