This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi there, I'm trying to get image from a “not visible” chart control, here's the code:
But i got empty image with legend and title only, How to make the graph visible too? |
|
|
Hello Slavik This will be because some of parts of the Chart control require the control to be loaded for the axes to be updated and the data to be rendered. An internal dispatcher call we use for improved performance may also be affecting this. One option to work around this will be to load the chart in a near-invisible window to cause it to load. Next week I will look to see if there is a better solution. If not, I'll try provide sample code to use this window technique. Jason Fauchelle |
|
|
Hi Jason I will hope to better solution and sample code does not prevent, thanks. Slavik |
|
|
Hello Here is some sample code that uses an invisible window to fully load the chart and then create an image from it.
The ExportChart method starts by creating the chart just like you did. Then it calls the ForceRender method which creates the invisible window to load the chart. Next I use a Dispatcher to call a method that creates the RenderTargetBitmap and uses it to create the image. At the end of this method I then close the invisible window. Jason Fauchelle |
|
|
Hello, Jason Thank you for help, this is what I need. Best regards, Slavik |
|