Cross Plattform Chart Painting

I want to draw something like this dynamically:

In the moment its done on iOS with UIImagesViews and UILabels with custom OpenType fonts. It would be great if there is a way to do this cross platform wise for iOS, Android and Windows Phone.

I see many graphics library out there like HTML, OpenGL, CocosSharp.
I think HTML is not able to do this in a pixel-perfect manner. OpenGL is to complex for this few static lines. CocosSharp look interesting but I think even this is to complex for such an 'simple' image.

Does anybody have a suggestion into which technology I should have a deeper look to achieve this?

Posts

  • GlennStephens.8241GlennStephens.8241 AUXamarin Team, University, XamUProfessors, Developer Group Leader Xamurai

    OpenGL would probably be a way forward. You could probably make a custom Xamarin.Forms control based on an existing library like CrossGraphics https://github.com/praeclarum/CrossGraphics which has the ability to integrate with OpenGL, but uses a System.Drawing style interface.

  • JuergenKollerJuergenKoller DEUniversity ✭✭

    Thanks a lot Glenn! CrossGraphics is exactly what I was searching for!

    There are some issues with custom fonts and the windows samples but I think I can modify CrossGraphics accordingly thanks to the knowledge all you trainers gave to me in the last 4 months! :-)

    Since my Windows .NET knowledge is not that old there are some issues with the System.Drawing namespace which is not present any longer in Windows Phone? To keep the code more cross platform like I have rebuild some of the parts in my new 'SystemDrawingSupportLibraryV1.cs' class. It implements the missing parts Sizef, PointF, RectangleF for the CrossGraphics library in Windows Phone apps.
    Is there a better way to keep the code cross platform through the System.Drawing problems?

  • rene_ruppertrene_ruppert DEXamarin Team, University, XamUProfessors Xamurai

    @JuergenK‌ What about using HTML inside a WebView?

  • MarkSmith.8123MarkSmith.8123 USXamarin Team, University, XamUProfessors Xamurai

    I don't think you are using Xamarin.Forms, but if you are, all the control vendors have charts available, for example: http://www.telerik.com/xamarin-ui

  • JuergenKollerJuergenKoller DEUniversity ✭✭

    Thanks Mark - right now I'm not using Xamarin Forms but I think something like CrossGraphics integrated in Xamarin Forms would be a great idea.

    Thanks Rene - I've spend a lot of time using HTML and Webviews. There is a good ans simple source using a html canvas for drawing:

    html5canvastutorials.com

    but finally I failed trying to implement OpenType custom fonts on all platforms. Without working custom fonts HTML is useless for me.

    Right now I've implemented some missing functions in CrossGraphics for text alignment and custom font loading.
    Now I'm able to paint my charts the way I need them. Maybe somebody needs something similar here is the code:

    https://github.com/juergenkoller/CrossGraphics

    Some of the stuff is still incomplete and not that robust as it should be. Maybe the community can help improve the solution.

  • MarkSmith.8123MarkSmith.8123 USXamarin Team, University, XamUProfessors Xamurai

    @JuergenK - nice library!

  • JuergenKollerJuergenKoller DEUniversity ✭✭

    To keep the infos up to date Frank A. Krueger introduced his new library NGraphics. Looks like NGraphics could replace CrossCraphics.

    https://github.com/praeclarum/NGraphics

Sign In or Register to comment.