简体   繁体   English

在igDataChart中显示/隐藏多个系列中的一条线

[英]show/hide a line in multiple series in igDataChart

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. 它是igDataChart,具有两个或多个字段的实时数据,并且很难看到哪个值与字段相关,因为大多数数据同时具有相同的值。 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");
        });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM