Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.tooltipContainerSelector = ''; // No tooltip selector.
break;
case ChartType.GroupedBar:
this.chart = groupedBar();
this.chartSelector = '.grouped-bar';
this.chartClickSelector = '.grouped-bar .bar';
this.tooltipContainerSelector = '.grouped-bar .metadata-group';
break;
case ChartType.Heatmap:
this.chart = heatmap();
this.chartSelector = '.heatmap';
this.chartClickSelector = '.heatmap .box';
this.tooltipContainerSelector = ''; // No tooltip selector.
break;
case ChartType.Legend:
this.chart = legend();
this.chartSelector = '.britechart-legend';
this.chartClickSelector = '.legend-entry';
this.tooltipContainerSelector = ''; // No tooltip selector.
break;
case ChartType.Line:
this.chart = line();
this.chartSelector = '.line-chart';
this.chartClickSelector = ''; // No click selector.
this.tooltipContainerSelector = '.line-chart .metadata-group .hover-marker';
break;
case ChartType.ScatterPlot:
this.chart = scatterPlot();
this.chartSelector = '.scatter-plot';
this.chartClickSelector = ''; // No click selector.
this.tooltipContainerSelector = '.scatter-plot .metadata-group';
break;
this.tooltipContainerSelector = ''; // No tooltip selector.
break;
case ChartType.GroupedBar:
this.chart = groupedBar();
this.chartSelector = '.grouped-bar';
this.chartClickSelector = '.grouped-bar .bar';
this.tooltipContainerSelector = '.grouped-bar .metadata-group';
break;
case ChartType.Heatmap:
this.chart = heatmap();
this.chartSelector = '.heatmap';
this.chartClickSelector = '.heatmap .box';
this.tooltipContainerSelector = ''; // No tooltip selector.
break;
case ChartType.Legend:
this.chart = legend();
this.chartSelector = '.britechart-legend';
this.chartClickSelector = '.legend-entry';
this.tooltipContainerSelector = ''; // No tooltip selector.
break;
case ChartType.Line:
this.chart = line();
this.chartSelector = '.line-chart';
this.chartClickSelector = ''; // No click selector.
this.tooltipContainerSelector = '.line-chart .metadata-group .hover-marker';
break;
case ChartType.ScatterPlot:
this.chart = scatterPlot();
this.chartSelector = '.scatter-plot';
this.chartClickSelector = ''; // No click selector.
this.tooltipContainerSelector = '.scatter-plot .metadata-group';
break;
public drawLegend() {
this.legend = legend();
if (this.data) {
let legendContainer = d3Selection.select(this.el).select('.legend-chart-container'),
containerWidth = legendContainer.node() ? legendContainer.node().getBoundingClientRect().width : false;
if (containerWidth) {
this.legend.width(containerWidth);
for (let option in this.chartConfig['properties']) {
if (this.legend.hasOwnProperty(option) && option !== 'colorSchema') {
this.legend[option](this.chartConfig['properties'][option]);
}
}
if (this.chartConfig.hasOwnProperty('colors')) {
if (this.chartConfig['colors'].hasOwnProperty('colorSchema')) {
LegendChartComponent.prototype.drawLegend = function () {
this.legend = legend();
if (this.data) {
var legendContainer = d3Selection.select(this.el).select('.legend-chart-container'), containerWidth = legendContainer.node() ? legendContainer.node().getBoundingClientRect().width : false;
if (containerWidth) {
this.legend.width(containerWidth);
for (var option in this.chartConfig['properties']) {
if (this.legend.hasOwnProperty(option) && option !== 'colorSchema') {
this.legend[option](this.chartConfig['properties'][option]);
}
}
if (this.chartConfig.hasOwnProperty('colors')) {
if (this.chartConfig['colors'].hasOwnProperty('colorSchema')) {
if (colors.colorSchemas.hasOwnProperty(this.chartConfig['colors']['colorSchema'])) {
this.legend.colorSchema(colors.colorSchemas[this.chartConfig['colors']['colorSchema']]);
}
}
else if (this.chartConfig['colors'].hasOwnProperty('customSchema')) {