Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

cannot create a SelectionID

My custom visual is based on the sample bar chart from Microsoft.    My capabiliteis.json "dataRoles": [ { "displayName": "Categories", "description": "Add your measure here to dis...
  • dm-p's avatar
    7 years ago

    Hi Anonymous,

    Thanks for the link - it was very helpful as the issue was not specifically in that part of the code. The host object in your createSelectionIdBuilder call is null at run time. Because of this, there is no method against it and the routine crashes out.

    Add the following to your constructor function in visual.ts:

    this.host = options.host;

    This will ensure that when it is passed to your visualTransform call in the update method, that the host is actually instantiated with the correct object.

    Here's my output for reference:

    I didn't need to make any changes to the code in your function detailed above, so your undersanding of the selection ID stuff is all good :)

    Hopefully you're on your way now!

    Daniel