Forum Discussion
Custom Visual gets 5 updates on startup
Hi emiljas,
Using the sample bar chart repo, If I refresh the visual with data in the data view, I get one update with a 510 (VisualUpdateType.All) as expected:
The only time I can get multiple update methods to be called is when I put the visual in and out of focus mode (which is expected due to changes in the viewport between states).
Regards,
Daniel
dm-p I also gets 510 when I hit refesh button but could you check what if you save report and reload page?
- dm-p2 years agoSuper User
If I save and reload the page, I do get a few more updates. These are not necessarily the same as you, or in the same order, but there are definitely more of them:
Interestingly, if I navigate away from the report and re-open it, I just get two VisualUpdateType.Resize | VisualUpdateType.ResizeEnd updates when my visual loads:
If I do a 'refresh visuals' operation (top-right corner when viewing the report), I get the following:
I would presume that there are reasons for the quantity of the updates, and I would still recommend my advice of defensively handling update types for your visual so that you only run the logic you need to when you need to. However, if you want to know why these updates occur, it would be best to check with MS directly. They don't monitor the forums, so you can either open an issue in the powerbi-visuals-api repo or email them at [email protected] for specific questions.
Regards,
Daniel