When exporting a xamDataChart that is viewable to the user, I get everything I'd expect to get in the image out. But if the xamDataChart is not viewable to the user (because the graph is in another tab, for instance), the resulting image is missing the Axis and AxisLabels and any series that should be contained in the Legend.
How do I fix this?
Hello Ed,
I have been looking into your requirements and it seems that the following forum thread will be helpful in this case: http://es.infragistics.com/community/forums/t/94149.aspx. I have modified the sample Stefan attached there so that the chart is displayed in a tab control. If the user chooses the second tab, the one without a chart, and press the button to export, the chart is exported including the labels. Could you please have a look at the sample application and let me know if it is helpful for you? Thank you.
Hello Maria,
I copied your PrintChart code directly and still got the same result. Is it possible that this is not working because how I use the graph axes?
xamDataChart graph = new xamDataChart);
AxisCollection axisCollection = graph.Axes;
NumericXAxis xAxis = new NumericAxis();
NumericYAxis yAxis = new NumericYAxis();
axisCollection.Add(xAxis);
axisCollection.Add(yAxis);
You also have to make sure that you call the RenderSize, Measure and Arrange methods on your XamDataChart before you export it to image. You can see how to call these methods in Maria's sample in the SetupManualChart method. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Since the Legend is a separate element, you have to call the RenderSize, Measure and Arrange methods for it, too. As for the shrinking of the graph, it will be very helpful if you could send us an isolated sample project where this issue is reproduced, so we could be able to investigate it further for you.
Let me restate that I get the correct axis labels, but there is no legend using the functions you suggested. Nevertheless, I still have this major issue with my graph scaling in the upper left corner.
When I add those functions, my graph does include the axis labels, but not the graph in the exported image. But there is a very series negative side effect! When I switch back to my graph in my application, the size of my graph has shrunk and is stuck up in the left!
This is really bad, as i can't get the image to scale back to original size.