[Plot] Prevent duplicate query on bounds change

Bounds change triggers a clearing of plot history, which triggers
a user interaction change, which was triggering a second query.

This change sets a flag to prevent the requery from the user interaction on
bounds change.  This flag could potentially be reused elsewhere, e.g. if we
wanted to prevent requery when not utilizing a minmax data source.

fixes #2126
This commit is contained in:
Pete Richards 2018-07-25 11:44:14 -07:00
parent 15a75ac134
commit ef9c6d5fed

View File

@ -181,7 +181,9 @@ define([
};
this.config.xAxis.set('range', newRange);
if (!isTick) {
this.skipReloadOnInteraction = true;
this.$scope.$broadcast('plot:clearHistory');
this.skipReloadOnInteraction = false;
this.loadMoreData(newRange, true);
} else {
// Drop any data that is more than 1x (max-min) before min.
@ -234,7 +236,9 @@ define([
var xDisplayRange = this.config.xAxis.get('displayRange');
var xRange = this.config.xAxis.get('range');
this.loadMoreData(xDisplayRange);
if (!this.skipReloadOnInteraction) {
this.loadMoreData(xDisplayRange);
}
this.synchronized(xRange.min === xDisplayRange.min &&
xRange.max === xDisplayRange.max);