Skip to content

Commit

Permalink
send K4D3 the ordered property when we send it ordered data.
Browse files Browse the repository at this point in the history
closes #88
  • Loading branch information
Spencer Alger committed May 22, 2014
1 parent 4ebf780 commit 03b3b27
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(function (require) {
return function HistogramConverterFn(Private) {
return function HistogramConverterFn(Private, timefilter) {
var _ = require('lodash');
var aggs = Private(require('../_aggs'));

Expand All @@ -20,10 +20,19 @@ define(function (require) {
}) - 1;
}

var agg = columns[iX].agg && aggs.byName[columns[iX].agg];
if (agg && agg.ordinal) {
var xAgg = columns[iX].agg && aggs.byName[columns[iX].agg];
if (xAgg && xAgg.ordinal) {
// TODO: add interval, min, max data here for the chart
chart.ordinal = {};
if (xAgg.name === 'date_histogram') {
var timeBounds = timefilter.getBounds();
chart.ordered = {
date: true,
min: timeBounds.min.valueOf(),
max: timeBounds.max.valueOf()
};
} else {
chart.ordered = {};
}
}

// X-axis description
Expand Down

0 comments on commit 03b3b27

Please sign in to comment.