Rendering a chart without showing it

Oct 6, 2009 at 11:41 AM

Hello

I have a simple chart, that I bind data to. The result is a nice graph.

I want to reuse the usercontrol with the chart when printing. In some cases, the usercontrol with the chart is not shown when printed. The result is that the graph-line is not shown. The rest of the chart is shown, but not the graph-line.
I assume the reason for this is, that the chart is not rendered before it is shown. How do I force it to render programmatically?

 

Oct 6, 2009 at 8:55 PM

Hi,

I have the same problem. Printing to XPS writer shows everything perfectly, but when printing on a "real" printer, the series is not visible there. Even rendering it to a bitmap doesn't work for me. It has the same effect.

I hope someone can help here...

Oct 8, 2009 at 6:22 AM

Hello,

I also have the same problem. Showing the chart is not a problem, but no series when printing. It would be nice to have some help.

Thanks.

May 12, 2010 at 2:10 AM

I am having the same issue with exporting to XPS, Any Ideas?

May 12, 2010 at 8:58 AM
Edited May 12, 2010 at 8:59 AM
Does that problem also occur when you have already shown the chart in the GUI? I think there already a few discussions in the forum which explain that the little animation which makes the line fade-in causes that the line is not yet shown when you simply render it. A solution is to override the style to a version without animation. Off-Topic: Does anybody know why this forum sometimes completly ignores all my formatting?
May 12, 2010 at 10:42 AM
ernii23 wrote:
Does that problem also occur when you have already shown the chart in the GUI? I think there already a few discussions in the forum which explain that the little animation which makes the line fade-in causes that the line is not yet shown when you simply render it. A solution is to override the style to a version without animation. Off-Topic: Does anybody know why this forum sometimes completly ignores all my formatting?

Hi ernii, 

Thanks for that, yes upon investigation it is caused by the "fade-in feature" of series; overriding the behaviour in the VSM in the control template fixes it...... mostly.... I am still having issues with this for the new StackedSeries feature, it is still not displaying the series even though I have cancelled the initial "fade-in". If I switch the series to Column it displays correctly.

Any ideas would be greatly appreciated. 

Jul 23, 2010 at 3:28 PM
Edited Jul 24, 2010 at 11:51 AM
Some problems over here. I already have a datapoint style that sets the template. But with line series I only see the datapoints, not the line itself. I thought (and still think) it is the StaggeredStateChange in DataPointSeries that always fires up a storyboard. But it is private method. When I plot the chart to a seperate window and then save it: all is well. I created this workaround, not really nice, but it works: // create copy of chart. Chart dupe = chart.DuplicateChart(model.chartSettings); dupe.Width = 700; dupe.Height = 500; Window win = new Window(); win.SizeToContent = System.Windows.SizeToContent.WidthAndHeight; win.Content = dupe; win.ShowInTaskbar = false; win.WindowStyle = System.Windows.WindowStyle.None; win.AllowsTransparency = true; win.Opacity = 0; win.Owner = this; win.Show(); this.Focus(); ..... Copy to clipboard, save, print...