Export chart to png (Chart.js) - chart.js

Is there anyway to export the chart to a image without the need to create a canvas and all. This is what I am trying to do, first I want to create a chart with all the necessary data and then I want to export that to png all in the server side, without touching html.

Chart.js is a canvas based library so you always need some sort of canvas, either a normal one, an offscreen one or an equivalant in node. If you dont want to create your own canvas you can use quickChart. Here you can pass your config and you get a png with that chart back

Related

Use same chart across multiple canvas

How can I use the same chart to be rendered across multiple canvas. I want to create one ChartJs object and assign it to multiple canvas.
You can't, what you can do is create 1 config object and call new Chart multiple times each time with another canvas id.
Other solution is to create the chart once and call .toBase64Image() on it and set that as an image source for multiple images so that you only have to create your chart once but can show it multiple times

Change the order of ColumnLayout or ListView and save / restore it

I'm working on a stream overlay that extracts information out of a game (flight simulator) and displays it on the screen. Right now I'm using Qt in conjunction with a *.html to render the overlay. It is all working really well, however I wanted to add some customization options for the users of my overlay software and I figured the best way would be to render the Overlay in QML.
The main part of the overlay is a row that contains around 8 "elements" that display the relevant data.
One thing that should be customized is the order of the elements in the row. But I really have no idea how to implement this feature. I've seen a few posts and tutorials on how to customize the order in a View using the DelegateModel. However right now it's not a view but QML Components inserted in a RowLayout due to the fact that they are all different components (e.g. some of the images are actually animated for which I'm using a component that uses Canvas2D to draw the images). I guess I could figure out a way to store those elements in a model using the Loader Component to display the content in QML. But even then I'm not entirely sure how to store and restore the order of the elements. As far as I can tell the DelegateModel only changes the View and not the underlying model.
Any suggestion or best practice to accomplish my goal would be highly appreciated.

Using chart.js to output chart as a saved image rather than using canvas

I am chart.js to create a chart and display it on the screen and this is fine.
Is it possible to get chart.js to output the chart as an image that can be saved without using canvas? The reason is that I would like to include the image in a pdf but do not want to have to see it on the screen first.
have you checked out the "dom-to-image" library?
Hope this helps!
Dom-To-Image Library

Get window icon, put it on canvas, overlay image, save as ico (WinXP and Win7)

Right now I change the icon of a window with this code.
What I want to do though is get the current icon in use by a window. Then put it on a canvas. Then put another image on that (a badge) then save it as ico.
Never tried that, however the follow should work in general (with a lot of fiddling)
WM_GETICON to get the big and small icon.
Convert the icon to something the loader can understand (aka. either a BITMAP or ICO). E.g. How can I save HICON to an .ico file?
Load the image. E.g. Javascript: Render PNG stored as Uint8Array onto Canvas element without Data URI
canvas.drawImage
canvas.mozGetAsFile (Blob) or canvas.mozFetchAsStream (nsIInputStream) using the image/vnd.microsoft.icon mime.
Take the resulting data and reconstruct an icon.
LookupIconIdFromDirectoryEx and CreateIconFromResourceEx
WM_SETICON

Chart templates, color schemes and font sizes

I'm trying to automate some PowerPoint charts, but I'm having problems preserving some formatting.
When I add a chart using a chart template, the chart doesn't use the slides color scheme, but rather the colors it was saved with. It doesn't help to change the color scheme for the slide - the chart isn't updated. To make the chart update to the color scheme of the slide, I have to clear formatting for the chart. The problem with doing this is that all font sizes are automatically set to 18pt. I cannot find any easy way restore the font sizes for the chart without saving all sizes before calling clear, and set them back after clearing.
Have you looked into using the Format Painter function it may or may not work depending on a variety of factors from my quick look on the net (google it for lots of articles).
Also if you've done one chart you should be able to copy the formatting from one chart to another using the paste special option as mentioned here http://www.pcreview.co.uk/forums/there-format-painter-equivalent-use-many-charts-t3611646.html .