How to reload a lightningchart? - lightningchart

Trying to reload a lightningchart by simply calling the following twice (simplified to be concise)
//'viz' points to an existing element in the DOM where the chart is bound to
lightningChart().ChartXY({container: 'viz' })
The first time around the chart renders fine.
The second time, I'm getting a WebGL error:
WebGL: INVALID_OPERATION: bindBuffer: object does not belong to this context
This is likely caused by a WebGL context that is not freed between invocations.
Problem is how to reset the chart (and thus the canvas and/or WebGL context) before rendering the chart again? I tried chart.dispose() but this doesn't seem to work
Any pointers?

I am pleased to inform you that the issue has been fixed in our LCJS release v2.0.3. You can try and test this with our latest LCJS release. Visit https://www.arction.com/lightningchart-js-installation/
Thank you and please do mark this an answer if it solves the problem.

Related

Qt widget stops receiving paintevents

I have been doing an implementation of Conways game of life in PySide [source]. So far it works good until a point in which, under certain conditions I havent figured out yet, the QGraphicsView i use to display the grid (which consists of several QGraphicsRectItems on a QGraphicsScene) suddenly stops being painted continuously. The rest of the window remains responsive and the game thread keeps running and signaling for the ui to update the current generation number. It is only when the window gains focus that the graphicsView updates for about a second and then freezes again.
I find this behavior particularly strange given that i dont override paintEvent, nor call repaint/update methods at all, but what the game thread does is to update every RectItem's brush color according to the status it should have every generation.
Any ideas on what could be causing this?
btw this is on Kubuntu 14.04.3 / KWin 4.11.11 / Qt 4.8.6
Managed to solved it myself! In case someone runs into same issue, all that i needed to do was to schedule an update by calling the update method of the qgraphicsscene every generation (i.e. after operating on the graphicRects from the game thread).
I assume the strange behavior was probably the result of trying to save cpu load, since for the gui thread there was no work to be done!

Quartz 2D substitude for graphicsPort in SDK 10.10

The scenario:
I'm editing some CGImages and strangely enough until now I was first creating NSImages from those CGImages before drawing them. So I tried to change the code so that I would draw the CGImages directly in into NSGraphicsContext.currentContext().graphicsPort. As you see I'm using Swing here but the same problem goes for Objective-C I presume.
Having a look into the documentation I saw that graphicsPort will be deprecated in 10.10, but I couldn't find another way to the current CGContext from NSGraphicsContext nor is there a way to create the CGContext from an NSGraphicsContext.
The Question:
Does anybody know what the proper way to retrieve the context would be? If not - Is there a way to cast the graphicsPort's COpaquePointer, which apparently is an initialized NSPipeObject, to a CGContextRef? Although using code that has already been marked deprecated would be quite unsatisfactory I would consider it until there is a better solution.
After spending a half hour digging around for information on this, I realized I should just check out the header file for NSGraphicsContext. Turns out there's a new property on NSGraphicsContext that's apparently not documented yet: CGContext. The header also notes that this should be used instead of graphicsPort.

Why QGrapchicsScene invalidate for foreground seems to throws updating on itemlayer?

I have a 'map' with 100.000 rectangles at the 'itemslayer',
I want to have a dynamic line creation and I draw it at Foreground layer. (That is, I dont want to have a lot of updates... )
The performance is poor, you note the mouse heavy to move, An I think that is an update for every rectangle that this line 'touchs' .
What is for the foregroundlayer then? I thought that It'd let me to draw over a grapchisview without updating the itemlayer...
Maybe it is related with there is not cache for foreground ?
Any idea ? Thanks.
When I was reading the documentation on 4.8.0 and it states this:
Note that QGraphicsView currently supports background caching only (see QGraphicsView::CacheBackground). This function is equivalent to calling update() if any layer but QGraphicsScene::BackgroundLayer is passed.
So, if you just want to update the foreground layer, then it will draw everything anyways, bummer...
I know it's not a answer, but it does confirm what you are seeing.

TypeError: Error #1009 - (Null reference error) With Flash

I am not an expert in flash, but I do work with AS and tweak Flash projects, though not having deep expertise in it. Currently I need to revamp a flash website done by one another guy, and the code base given to me, upon execution is throwing the following error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at NewSite_fla::MainTimeline/__setProp_ContactOutP1_ContactOut_Contents_0()
at NewSite_fla::MainTimeline/frame1()
The structure of the project is like, it has the different sections split into different movie clips. There is no single main timeline, but click actions on different areas of seperate movie clips will take them between one another. All the AS logic of event handling are written inline in FLA , no seperate Document class exists.
Preloader Movie clip is the first one getting loaded. As i understood the error is getting thrown initially itself, and it is not happening due to any Action script logic written inline, because it is throwing error even before hitting the first inline AS code.
I am not able to figure out what exactly is causing the problem, or where to resolve it. I setup the stuff online, for reference if anybody want to take a look at it, and here is the link. You need to have flash debugger turned ON in your browser, if need to see the exception getting triggered.
I really got stuck at this point. Any help will be great. I had not seen the particular solution I am looking for anywhere yet, though Error #1009 is common.
Did you set the option "Export at frame 1" for the classes in your library?
I get this error for instance:
I have a circle which is a Circle class and put it on Frame 10.
If I try to attach a eventHandler to it from frame 1, I get this error.
Set the option "Export at frame 1" for my Circle class will solve this issue for me.

How to find where an object is created in flex/actionscript 3?

In my project I have noticed 20-40% CPU time when my app is idle.
In debugger when I pause I always land on a flex.utils.Timer/tick.
This timer has 30ms delay between "ticks"
I didn't create that Timer... so this is problably a component I have added
Unfortunately it will be difficult to remove all compenents until if find the "one" ..
Yes I should have notice the CPU usage sooner !
and yes I will do that if I don't find another solution
I am of course using some components without having their sources...
My questions :
* How can I find the guilty component ?
* I tried to find it using Kap Inspector without success ...any tips for Kap inspector ?
* Is there another great tool to track object creation ?
Thanks for your help
When you set your breakpoint, in the Flex Debugger perspective, find the Variables tab/view. From there, with your breakpoint set, you should be able to see all of the variables currently in local scope (local to the timer-tick event handler, that is). The event variable will contain information about the timer itself -- e.g., in event.target -- and the this variable will tell you where the timer handler is defined.
From there, you might be able to walk back up the stack trace, using the Debug tab/view (with your breakpoint still set), to get a sense of where the Timer object might've been instantiated. If that doesn't work, you can download a trial of Flex Builder Professional here:
http://www.adobe.com/cfusion/entitlement/index.cfm?e=flexbuilder3
... and give the built-in profiler a try. Hope that helps point you in a helpful direction!
No idea about Flex, but for your CPU problems, check this out:
http://www.gskinner.com/blog/archives/2009/05/idle_cpu_usage.html

Resources