epochjs / epoch

A general purpose, real-time visualization library.
http://epochjs.github.io/epoch
MIT License
4.97k stars 279 forks source link

filter is not a function problems #230

Closed AlfieJ closed 7 years ago

AlfieJ commented 7 years ago

Good morning.

I've been looking to replace our charting library and this morning I started evaluating Epoch. But I quickly ran into two problems. The first was an error on line 429 of epoch.js:

d3Seconds = d3.time.format('%I:%M:%S %p');

It appears that a recent d3 update changed things related to time, so modifying that line to read:

d3Seconds = d3.timeFormat('%I:%M:%S %p');

solved that problem.

But now I'm running into a problem inside Base.prototype.getVisibleLayers on line 669:

return this.data.filter(function(layer) {

Both Firefox 49 and IE 11 are giving the same error that the filter function doesn't exist, so it's not the pre-IE9 filter issue.

Fixing this one isn't as clear to me...what can I do to fix this?

Thank you, Alfie

AlfieJ commented 7 years ago

For those that are interested, when you pass the plot data to Epoch, you pass an array of data, as is clearly shown in the instructions, like so:

var lineChartData = [
  // The first series
  {
    label: "Series 1",
    values: [ {x: 0, y: 100}, {x: 20, y: 1000}, ... ]
  },

  // The second series
  {
    label: "Series 2",
    values: [ {x: 20, y: 78}, {x: 30, y: 98}, ... ]
  },

  ...
];

Which I was not doing. My apologies.