Jump to content
Software FX Community

Microsoft Samples DrawVisual returns distorted chart.


Recommended Posts

Microsoft had provided some sample code that would draw a complex "living" visual tree into a "dumb" DrawingGroup.  We're looking at incorporating this code into our application.

 I created a simple test that would render a ChartFX WPF chart to  DrawingGroup (see attachment).  Compile the solution and when the chart appears, right-click anywhere on it and you'll see a DrawingGroup version of the Chart appear in a new window.

 It looks like a transform or brush is being skipped someplace, and it seems like it's internal to the Chart.  There's one border in the tree that isn't freezable in this sample, and I'd assumed this was the cause, but in my own tests using custom-styled charts without the unfreezable border, the problem still appears.

 I was wondering if you could take a peek and let me know if there's anything I can add to the DrawingContextExtensions.cs class that would handle whatever is happening inside the Chart, or if there's a change you can make internally on your end that would help remedy this.  It seems like the former should be possible, as the Chart renders fine but it's just the visual-grabbing that seems to fail.

Let me know if there's anything else I can provide that would help.  Thanks!


Link to comment
Share on other sites

I am not sure if this is a bug in our code or something wrong in DrawingContextExtensions, you can workaround this issue by setting the PlotArea.ClipToBounds to false to avoid clipping. Most of the time setting ClipToBounds to false will have no effect unless you are manually setting the Y min/max.

chart.PlotArea.ClipToBounds =



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...