javascript - Multiple D3js graphs on one view cause performance isues when using responsive disign -


I have about 20 charts on the same scene, unless I try to apply the graph inside the responsive design By then, everything works properly. Each article has a different ID

I am using the cornerry instructions to make those graphs.

This piece of code is troublesome:

  var the_chart = $ ("#" + attrs.id + "chart"), aspect = the_chart.attr ("width ") / The_chart.attr (" height "), container = element.parent (); $ (Window) .on ("resize", function () {var targetWidth = container_width (); the_chart.attr ("width", targetWidth); var value = monastery (target / aspect); the_chart.attr ( "Height", value);}). Trigger ("resize");   

The problem is that I repeatedly say directive x number and in every instruction I call the code piece above. It will perform well for illustrations of 1 or 2, but the more graphs you have, the more performance problems. The triggers ("resize") will be the reason because many examples of $ (window) Re-submit .on ("resize" ...) has been created.

I have to be forced to resize because the width of the container is not set until the whole scene is presented.

Is there any solution What is my problem?

I had a similar problem.) My code is very slow Started. It does not help in h-shaw / ng-hiding I was confused. Director NG-If my problem is resolved.

You should create a structure like this:

  & lt; Div ng-if = "...." & gt; ... & lt; / Div & gt; & Lt; Div ng- if = "...." & gt; ... & lt; / Div> & Lt; Div ng-if = "...." & gt; ... & lt; / Div & gt; ...   

is not:

  & lt; Div & gt; .... & lt; / Div & gt; & Lt; Div & gt; .... & lt; / Div & gt; & Lt; Div & gt; .... & lt; / div & gt;    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -