LaintalAy
LaintalAy

Reputation: 1192

How to modify the 'nodes' behaviour in Zingchart

I plot some series of data with Zingchart. The data is one entry per second, per set. The result is the following graph:

zoom out graph.

I am happy with this result. I get an overview of the plot that is very fast using "exact":false as plot attribute. Afterwards, I want to be able to 'zoom in' to see the detail:

zoom in graph

And now I have too much detail. The attributes I have for plot are:

          "maxNodes":2000,
          "maxTrackers":2000,

I have been trying to play with those numbers but at the end, if I reduce the number I just have to zoom-in more. As I understand I get one node/tracker/information popup per data entry in the current status of the visualization only if there are less nodes than the limit defined.

Would it be possible to indicate Zingchart to place the nodes not in every data point, but with some kind of interval or intention?.

For example, in the second graph I would like to have nodes at the beginning / end and on the jump that the line makes. Or local maximums / minimums.

Upvotes: 3

Views: 170

Answers (1)

Patrick RoDee
Patrick RoDee

Reputation: 1106

There are a few options.

1) You could change the "max-nodes" to a lower number. "max-nodes" just determines how many nodes are drawn while "max-trackers" determines how many you can interact with.

2) You could also add the following to your plot object...

marker: {
  rules: [
    {
      rule: '%i%5 > 0',
      visible: false
    }
  ]
}

What that does it it checks the index (%i) of each marker. If the index of the marker modulo 5 is greater than 0, we don't display the marker (node). That means that all nodes except those evenly divisible by 5 will be hidden.

I'm on the ZingChart team. Let me know if this helps. Holla if you've got more questions.

Upvotes: 3

Related Questions