Fix sending of ordered key to vislib

This commit is contained in:
Rashid Khan 2014-08-21 16:43:10 -07:00
parent 1a5b1ff967
commit fe04820efa
3 changed files with 15 additions and 8 deletions

View file

@ -7,6 +7,7 @@ define(function (require) {
this.name = config.name;
this.title = config.title;
this.makeLabel = config.makeLabel || _.constant(this.name);
this.ordered = config.ordered;
var params = this.params = config.params || [];

View file

@ -61,14 +61,14 @@ define(function (require) {
date: true,
min: timeBounds.min.valueOf(),
max: timeBounds.max.valueOf(),
interval: interval.toMs(colX.aggParams.interval)
interval: interval.toMs(colX.params.interval)
};
}
else {
chart.xAxisFormatter = colX.field && colX.field.format.convert;
chart.ordered = aggX && aggX.ordered && {};
if (aggX !== false && colX && colX.aggParams && colX.aggParams.interval) {
chart.ordered.interval = colX.aggParams.interval;
if (aggX !== false && colX && colX.params && colX.params.interval) {
chart.ordered.interval = colX.params.interval;
}
}

View file

@ -18,18 +18,24 @@ define(function (require) {
// the list of "configs" that we will use to read the response
var configs = vis.aggs.getSorted().map(function (aggConfig) {
return _.assign(
aggConfig.type.params.write(aggConfig),
aggConfig.schema.params.write(aggConfig),
var aggParams = aggConfig.schema.params.write(aggConfig);
var chartDataConfig = _.assign(
{
categoryName: aggConfig.schema.name,
id: aggConfig.id,
aggConfig: aggConfig,
aggType: aggConfig.type,
field: aggConfig.params.field,
label: aggConfig.type.title
}
label: aggConfig.type.title,
},
_.merge(
aggConfig.schema.params.write(aggConfig),
aggConfig.type.params.write(aggConfig)
)
);
return chartDataConfig;
});
var lastConfig = configs[configs.length - 1];