Adding Landing-Page to the Bar Chart

Step by step guide how to build simple Bar Chart Visual

Adding Landing-Page to the Bar Chart

As of API 2.3.0, you can add a landing page to your visual, to do so, simply add supportsLandingPage to the capabilities and set it to true, this will make your visual initialize and update even before adding data to it (meaning it will no longer show a watermark) so you can design your own landing page to show in the visual as long as it has no data.

export class BarChart implements IVisual {
    private element: HTMLElement;
    private isLandingPageOn: boolean;
    private LandingPageRemoved: boolean;
    private LandingPage: d3.Selection<any>;

    constructor(options: VisualConstructorOptions) {
            this.element = options.element;

    public update(options: VisualUpdateOptions) {

    private HandleLandingPage(options: VisualUpdateOptions) {
        if(!options.dataViews || !options.dataViews.length) {
            if(!this.isLandingPageOn) {
                this.isLandingPageOn = true;
                const SampleLandingPage: Element = this.createSampleLandingPage();

                this.LandingPage =;

        } else {
                if(this.isLandingPageOn && !this.LandingPageRemoved){
                    this.LandingPageRemoved = true;

    private createSampleLandingPage(): Element {
        let div = document.createElement("div");

        let header = document.createElement("h1")
        header.textContent = "Sample Bar Chart Landing Page";
        let p1 = document.createElement("a");
        p1.setAttribute("class", "LandingPageHelpLink");
        p1.textContent = "Learn more about Landing page";

        p1.addEventListener("click", () => {


        return div;

See commit for what was added at this step.