Skip to content
HighCharts mashup for plotting important chronological events on top of your trending data
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Use EpochChart to compare data trends with events

Plot chronological events on top of your trending data to learn what decisions, product changes or macro events affected your numbers. You give it the analytics data and named events, it shows you how the two play together.

Built by @jfeldstein. Wraps (and thus requires) HighCharts. Originally announced on

This code is free. Go nuts.

Get it:

  1. Have jQuery and Highcharts already installed in your project.
  2. Download jquery.epochchart.js into your project.
  3. Have fun!

It's used like so:

// One line
$('#chart').epochchart(line,  markers [, options]);


// Multiple lines
$('#chart').epochchart(lines, markers [, options]);

It supports these options:

  // Change the marker used to denote events, or link to a custom image.
  marker: url(marker.png), 

  // Overwrite the options we pass into Highcharts here. 
  // Use anything from
  highchartsOpts: { ... },

  // Change the date formats in tooltips and the x-axis by entering a
  // Highcharts.dateFormat-compatible formatting string.
  // See:
  dateFormat: '...',

  // Reposition the fixed tooltip. Pixel values from the top left. 
  tooltip: {x: 30, y: 10}

Simple Usage Examples:

1. Graph one line, with markers:

<div id="oneline"></div>

  // Dates as unix timestamps
  var line    = {
    name: "The Line",
    data: [[1259114255000, 2], [1259200655000, 2.25], [1259287055000, 5]]

  var markers = [[1259200655000, "Hired the new sales guy."]];

  $('#oneline').epochchart(line, markers);

Which looks like:

An EpochChart with one line

2. Or to graph multiple lines:

<div id="chart"></div>

  // Dates as unix timestamps
  var data1   = [[1259114255000, 2], [1259287055000, 5]];
  var data2   = [[1259114255000, 5], [1259287055000, 2]];
  var lines   = [{
    name: "Line 1",
    data: data1
    name: "Line 2",
    data: data2
  var markers = [[1259200655000, "The intersection"]];

  $('#chart').epochchart(lines, markers);

Which looks like:

An EpochChart with TWO lines

3. Or pass overrides to the underlying Highcharts implementation:

<div id="chart"></div>

  // Anything from the HighCharts API:
  var opts = {
    highchartsOpts: {
      plotOptions: {
          spline: {
              color: '#FF0000'

  var line = {
    name: "A Single Line",
    data: [[1259114255000, 2], [1259287055000, 5]]
  var markers = [[1259200655000, "On the up!"]];

  $('#chart').epochchart(lines, markers, opts);

Which looks like:

An EpochChart with custom Highcharts options

Compile With

coffee --compile --watch

(thanks to jashkenas)

You can’t perform that action at this time.