cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
paul-maessen
Resolver I
Resolver I

Issues with Analytics Pane in Custom Visual

Hi,

 

I am trying to add the analystics-pane to my custom visual but i do have some issues.

I hope some one here can help me with these issues.

 

In the GIF below you can see that the Constant line in the analytics pane is created and displayed in my visual.

 

Constant line in Analytics PaneConstant line in Analytics Pane

 

I do have the following questions:

  • How can I add another Constant line to the visual ? (as you can see I do NOT get another "+Add" below the added constant line)
  • Is it possible to prevent the redraw of the Constant line-pane each time I make a change to it ? (This does not happen in the native visuals that are using the analytics pane).

I have created a very basic custom visual showing a bar chart to have not such a large amount of code.

You can find the code on the following repository on Git Hub: Github Repo  This repo is specifically created to show the issues. 

 

It would be nice if someone can help me with these questions, because I do get the same behavior when using the code from the Sample Bar Chart where an Average Line is implemented. (https://github.com/microsoft/PowerBI-visuals-sampleBarChart)

 

Thanks in advance!

 

Paul

 

2 ACCEPTED SOLUTIONS

I've gone ahead and raised an issue on the github repo.

https://github.com/microsoft/PowerBI-visuals-tools/issues/351  

View solution in original post

Fixed for all versions of the API.

Nikita Grachev,
Team Leader
Microsoft Power BI Custom Visuals,
pbicvsupport@microsoft.com

View solution in original post

17 REPLIES 17
nikitagrachev
Microsoft
Microsoft

It should be fixed already. Please check it again.

Nikita Grachev,
Team Leader
Microsoft Power BI Custom Visuals,
pbicvsupport@microsoft.com

Hi @nikitagrachev 

I tested it and it is solved indeed. Thanks.

I also noticed that the issue on Github us closed.

 

Regards

Paul

 

Hi @nikitagrachev 

In which version of the API is this fixed?

 

Regards

 

Paul

 

Fixed for all versions of the API.

Nikita Grachev,
Team Leader
Microsoft Power BI Custom Visuals,
pbicvsupport@microsoft.com
IlonaSimakova
Microsoft
Microsoft

Good afternoon, @paul-maessen !
Please check and let me know if the issue with the Analytics Pane is still relevant, thanks!

 

Ilona

Microsoft PBI Custom Visuals
pbicvsupport@microsoft.com

Hi @IlonaSimakova 

 

Yes this issue is still relevant. 

The issue on GitHub is also still open: https://github.com/microsoft/PowerBI-visuals-tools/issues/351

 

Regards,

 

Paul

v-shex-msft
Community Support
Community Support

HI @paul-maessen,

After I check your 'renderConstantLine' function, I found you use the 'select' function to extract '.constant-line' elements.
As the document mentioned, the select function only returns the first match result, but 'Constantline' may contain multiple instances.  I think you need to change these parts to handle multiple instance proceedings.

BTW, I attached the link of 'power bi visuals core' here, you can take a look at the old version of official visuals processings if helps:

PowerBI-visuals-core 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft ,

 

Thanks for your reply.

 

You are right about the "renderContantLine"-function. But in this case I am only able to create just one line because I do not get the "+Add" again once I created a constant line. In that case there is only one line...

 

One of my questions is now. How do I get this "+Add"-button to be able to create multiple lines?

 

Regards

 

Paul

Hi @paul-maessen,

Thanks for dm-p 's notice, it seems like I missed the document that lists the known limitations of adding an analysis line to custom visuals.

As the document mentions, currently you can't do multiple instance processing of constant line. For this scenario, perhaps you can consider submitting an idea to add support for this feature.
Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @paul-maessenn,

There's no multi instance support yet, so you currently cannot add further instances to an object. 1 is the limit 😞

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Hi @dm-p , @v-shex-msft 

 

Indeed I completely missed the limitation about multi-instance support also.

Then there is just one issue left...

 

As you can see in the initial post the analytics pane is rerendered every time something is changed. Can this be solved?

 

Regards

 

Paul

Hi @paul-maessen,

It's a bit late in the evening for me to check out your code and reproduce locally, and I'm having a look at your repo on my phone but if I had to guess, it looks like you might be executing VisualSettings.enumerateObjectInstances three times in your Visual.enumerateObjectInstances method (here, here and also here in the console.log). Each time this is executed, even for logging, it's going to enumerate your objects and probably refresh the pane each time. I might try to use the const declared in the first occurrence in your log statement and your return statement so you don't re-exexute the method again and see if this mitigates things.

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




I have noticed the same re-rendering behaviour in the example bar chart code (https://github.com/microsoft/PowerBI-visuals-sampleBarChart). Having done a few checks I can see that the enumerateObjectInstances() function seems to be called only once.

Agreed - I've just set up a bare-minimum example on a new visual and the re-rendering does appear to always happen, irrespective of any code to customise the object enumeration. I'd suggest raising an issue for this (if you haven't already) and see if the team can take a look.

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




I've gone ahead and raised an issue on the github repo.

https://github.com/microsoft/PowerBI-visuals-tools/issues/351  

Hi @dm-p ,

 

I have removed all the console.logs and it still happens.

If you can see in the attached gif it looks like it is "removing" the added constant-line and then adding it again after each change.

analytics-pane-rerender.gif

 

When I just look at the individual frames in the attached gif I see that the following screen is showing up after making a change

Screenshot 2021-01-29 at 11.22.28.png

As you can see here it is just saying there is no content for the Analytics Pane. So I am guessing that I am doing something wrong here 🙂

 

@dm-p Don't stay up late to look at it, there will be another day 🙂

 

Thanks!

 

Regards, 

 

Paul

Hi @dm-p ,

 

Thanks! I will check and disable logging also to see if that removes the rerendering.

 

Regards

 

Paul

 

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.