GetClippingRect fails due to XAxis and YAxis being null

Nov 23, 2011 at 8:49 AM

I am writing a render context using MonoTouch for IOS and I having trouble with rendering

var plot = ExampleLibrary.BarSeriesExamples.SimpleBarSeries();

I get an exception in the GetClippingRect method trying to acces XAxis and YAxis which are both null.

How do I go about setting these properties?

I am able use the below example and this works ok-ish

var plot = ExampleLibrary.PieSeriesExamples.LinearAxes();

Thanks

David

BTW: When I am done I will contribute the code back to you.

Nov 23, 2011 at 9:06 AM

cool to hear that you are working on a MonoTouch implementation!

Remember to call PlotModel.Update(true) to prepare the plot for rendering. This method will set the axes for the BarSeries.

After update, you can call PlotModel.Render with your MonoTouch render context. 

Nov 23, 2011 at 9:15 AM

That solved the problem. Thanks

Nov 25, 2011 at 8:52 AM

Hi,

I have checked in my changes to https://bitbucket.org/dvkwong/oxyplot.monotouch

This contains an example iphone app displaying the graphs from the examples assembly.

Supports png and pdf export as well.

Note the text rendering is not 100% perfect but I am sure someone can help out.

Also I made some minor changes to the core OxyPlot library Eg Allow changing of Default font, and 2 of the assemblies the csproj has ProjectTypeGuids

Thanks

David

Nov 25, 2011 at 11:13 AM

very cool! I'll have a look at the code later! Does it work with the evaluation version?

Can the same code be used to build for Mono for Android?

Nov 26, 2011 at 7:48 AM

Yes works with eval.

Not sure about Android.