private renderLegend()

in src/visual.ts [1055:1079]


    private renderLegend(streamGraphData: StreamData): void {
        const legendSettings: LegendSettings = streamGraphData.settings.legend;

        const title: string = legendSettings.showTitle
            ? legendSettings.titleText || streamGraphData.legendData.title
            : undefined;

        const dataPoints: LegendDataPoint[] = legendSettings.show
            ? streamGraphData.legendData.dataPoints
            : [];

        const legendData: LegendData = {
            ...streamGraphData.legendData,
            title,
            dataPoints,
            fontSize: legendSettings.fontSize,
            labelColor: legendSettings.labelColor,
        };


        this.legend.changeOrientation(LegendPosition[legendSettings.position]);

        this.legend.drawLegend(legendData, { ...this.viewport });
        positionChartArea(this.svg, this.legend);
    }