Pierre, many thanks for this. It does work, and paints nicely. I couldn't have easily resolved the correct way to do it in ⎕WC/WPF/.net!
There is unfortunately a problem, though (surprise :-)). It throws OutOfMemoryExceptions, appearing after having created ca 150 graphs, and then again after 100-200 more graphs, until exceptions gets more dense, and evetually it completely fails at attempt nr. one. Comes from:
Code: Select all
canvasObj←XamlReader.Parse(⊂xamlPlot)
but I'm in no way sure that's actually the faulty place, perhaps it's only the place telling about memory problems.
The only thing that helps is closing the APL session and starting it again. I've tried all possible ways to clean up in the code, assign ⎕NULLs etc., really tried to guarantee that nothing is left hanging, but without success so far. The involved objects do not have Dispose methods so it's about ⎕EX, ⎕NULL, localising. Perhaps I'm missing something there, but it's the APL interpreter itself that gets filled, and eventually Task Manager reports 1.3 GB for the APL process although there is nothing new in the workspace.
Yet another "feature" is the size of the XAML. A linechart with three data ranges (say 1500 values along X) and markers easily grow into 1 megabyte, and that already takes time to parse and process. I can count to 4 (rapidly, though) while the graph is thinking.
Still need to check out Pierre's solution, as it does a high quality graphical output, but I'd like to address Dyalog again:
As SharpPlot comes with Dyalog, and is so tightly integrated that it's even seen in the toolbar, is there really no connection between SharpPlot rendering (the SharpPlotViewer object that resides inside sharpplot.dll itself) and a GUI embedding made in APL, may it then even be a .net GUI? No RenderToHwnd() or RenderToControl()? Should I completely stop thinking about it?
Simply put: I have a hard time believing that I'd be the first one
ever wanting to have a SharpPlot graph in an APL form?