Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.chart.on('customDataEntryClick', function (e, d, m) {
that.chartConfig['click'](e, d, m);
});
} else if (this.chartType === ChartType.ScatterPlot) {
this.chart.on('customClick', function (e, d, m, s) {
that.chartConfig['click'](e, d, m, s);
});
} else {
d3Selection.select(this.el).selectAll(this.chartClickSelector).on('click', (ev) => this.chartConfig['click'](ev));
}
}
if (this.chartConfig.hasOwnProperty('tooltip')) {
this.tooltipContainer = d3Selection.select(this.el).select(this.tooltipContainerSelector);
if ([ChartType.Bar, ChartType.Step, ChartType.ScatterPlot].indexOf(this.chartType) > -1) {
this.tooltip = miniTooltip();
this.chart.on('customMouseOver', this.tooltip.show);
this.chart.on('customMouseMove', this.tooltip.update);
this.chart.on('customMouseOut', this.tooltip.hide);
this.tooltipContainer.datum(this.data).call(this.tooltip);
} else if ([ChartType.Line, ChartType.StackedArea, ChartType.GroupedBar, ChartType.StackedBar].indexOf(this.chartType) > -1) {
this.tooltip = tooltip();
this.chart.on('customMouseOver', function () {
that.tooltip.show();
});
this.chart.on('customMouseMove', function (dataPoint, topicColorMap, dataPointXPosition) {
that.tooltip.update(dataPoint, topicColorMap, dataPointXPosition);
});
this.chart.on('customMouseOut', function () {
private drawChart() {
this.bar = bar();
this.tooltip = miniTooltip();
let barContainer = d3Selection.select(this.el).select('.bar-chart-container'),
containerWidth = barContainer.node() ? barContainer.node().getBoundingClientRect().width : false;
if (containerWidth) {
this.bar.width(containerWidth);
this.bar.shouldReverseColorList(false);
for (let option in this.chartConfig['properties']) {
if (this.bar.hasOwnProperty(option) && option !== 'colorSchema') {
this.bar[option](this.chartConfig['properties'][option]);
}
}
let showTooltip = false;
if (this.chartConfig.hasOwnProperty('showTooltip') && this.chartConfig['showTooltip'] === true) {
that.chartConfig['click'](e, d, m);
});
}
else if (this.chartType === ChartType.ScatterPlot) {
this.chart.on('customClick', function (e, d, m, s) {
that.chartConfig['click'](e, d, m, s);
});
}
else {
d3Selection.select(this.el).selectAll(this.chartClickSelector).on('click', function (ev) { return _this.chartConfig['click'](ev); });
}
}
if (this.chartConfig.hasOwnProperty('tooltip')) {
this.tooltipContainer = d3Selection.select(this.el).select(this.tooltipContainerSelector);
if ([ChartType.Bar, ChartType.Step, ChartType.ScatterPlot].indexOf(this.chartType) > -1) {
this.tooltip = miniTooltip();
this.chart.on('customMouseOver', this.tooltip.show);
this.chart.on('customMouseMove', this.tooltip.update);
this.chart.on('customMouseOut', this.tooltip.hide);
this.tooltipContainer.datum(this.data).call(this.tooltip);
}
else if ([ChartType.Line, ChartType.StackedArea, ChartType.GroupedBar, ChartType.StackedBar].indexOf(this.chartType) > -1) {
this.tooltip = tooltip();
this.chart.on('customMouseOver', function () {
that.tooltip.show();
});
this.chart.on('customMouseMove', function (dataPoint, topicColorMap, dataPointXPosition) {
that.tooltip.update(dataPoint, topicColorMap, dataPointXPosition);
});
this.chart.on('customMouseOut', function () {
that.tooltip.hide();
});
BarChartComponent.prototype.drawChart = function () {
var _this = this;
this.bar = bar();
this.tooltip = miniTooltip();
var barContainer = d3Selection.select(this.el).select('.bar-chart-container'), containerWidth = barContainer.node() ? barContainer.node().getBoundingClientRect().width : false;
if (containerWidth) {
this.bar.width(containerWidth);
this.bar.shouldReverseColorList(false);
for (var option in this.chartConfig['properties']) {
if (this.bar.hasOwnProperty(option) && option !== 'colorSchema') {
this.bar[option](this.chartConfig['properties'][option]);
}
}
var showTooltip = false;
if (this.chartConfig.hasOwnProperty('showTooltip') && this.chartConfig['showTooltip'] === true) {
showTooltip = true;
this.bar.on('customMouseOver', this.tooltip.show);
this.bar.on('customMouseMove', this.tooltip.update);
this.bar.on('customMouseOut', this.tooltip.hide);
}