【问题标题】:Zingchart - some points are hidden in the graphZingchart - 图表中隐藏了一些点
【发布时间】:2016-05-11 13:31:30
【问题描述】:

我使用 Zingchart 来绘制一些日志数据,因此我需要显示图表中的每个点。我激活了 json 中的 points 属性(参见

$scope.graphoptions = {
            theme:"dark",
            "gui":{
              behaviors:[]
            },

            globals: {
              shadow: false,
              fontFamily: "Helvetica"
            },
            type: "line",
            plot: {
              aspect: "segmented",
              marker: {}
            },
            "legend":{
              margin :"5% 88%",
              layout: "float",
              fontSize : "10px",
              backgroundColor: "#888888",
              borderColor : "#000000",
              shadowColor : "transparent",
              toggleAction: "hide",
              item: {
                markerStyle : "circle",
                fontColor: "#ffffff"
              },
            },
            scaleX: {
              zooming: true,
              item: {
                fontColor: "white"
              },
              guide: {
                visible: false
              },
              "transform": {
                "type": "date",
                "all": "%G:%i",
              }
            },

            "scaleY": {
              zooming:true,
              lineColor : "#DDD",
              tick : {
                lineColor : "#DDD"
              },
              item : {
                fontColor : "#DDD"
              },
              refLine : {
                lineColor : "#DDD"
              },
            },

            tooltip : {
              //we have to store the tooltip fkt globally so its ouside angulars
              //scope thatswhy we have to pass the data to the function
           	  jsRule : "applyTooltip("+$scope.fileName+")",
              shadow:false
           	},

            plotarea: {
              "adjust-layout":true,
              backgroundColor : '#272822'
            },
          }

对于完整的 json)。

正如你在这个截图中看到的

读取的图表的一些点被绘制,但没有一个蓝色的点。 当我放大时:

显示蓝色图表的一些标记。 这是一个错误还是我必须激活我不知道的 json 中的其他属性。

提前致谢!

【问题讨论】:

    标签: javascript charts zingchart


    【解决方案1】:

    假设您的数据应该绘制在这些点上,那么您需要增加绘制在绘图上的默认标记的数量。默认情况下,ZingChart 根据点数和图表宽度计算此数字。

    • maxNodes: N 其中 N 是您希望在给定点显示的最大节点数。例如maxNodes: 1000

    • 如果工具提示在高分辨率下很重要,您还需要更改 maxTrackers: N,其中 N 是要跟踪工具提示的节点数量。请注意,这将严重降低性能,具体取决于要跟踪的节点数量。例如maxTrackers: 1000

    【讨论】:

    • 有没有办法让跟踪器在整个图表中“传播”?就我而言,我每秒也有数据,但我不希望每秒都有一个跟踪器……每 30 分钟/1 小时一个,或者在图表的尖峰中(局部最大值和最小值)会很棒。目前的行为是,如果点数多于跟踪器,它们就会被禁用。
    猜你喜欢
    • 2015-11-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-20
    • 1970-01-01
    相关资源
    最近更新 更多