showing too many series error just on heatmap

This commit is contained in:
ppisljar 2017-02-01 16:10:14 +01:00
parent 02eed36f3b
commit e5da6ac75b
3 changed files with 8 additions and 5 deletions

View file

@ -113,6 +113,8 @@ export default function HandlerBaseClass(Private) {
* @returns {HTMLElement} With the visualization child element
*/
render() {
if (this.visConfig.get('error')) return this.error(this.visConfig.get('error'));
const self = this;
const { binder, charts = [] } = this;
const selection = d3.select(this.el);

View file

@ -148,6 +148,12 @@ export default function ColumnHandler(Private) {
heatmap: (cfg, data) => {
const defaults = create()(cfg, data);
const seriesLimit = 25;
const hasCharts = defaults.charts.length;
const tooManySeries = defaults.charts[0].series.length > seriesLimit;
if (hasCharts && tooManySeries) {
defaults.error = 'There are too many series defined.';
}
defaults.valueAxes[0].show = false;
defaults.categoryAxes[0].style = {
rangePadding: 0,

View file

@ -33,11 +33,6 @@ export default function PointSeriesFactory(Private) {
this.chartEl = chartEl;
this.chartConfig = this.findChartConfig();
this.handler.pointSeries = this;
const seriesLimit = 25;
if (this.chartConfig.series.length > seriesLimit) {
throw new errors.VislibError('There are too many series defined.');
}
}
findChartConfig() {