Search code examples
ioswatchkitmpandroidchartios-charts

Can I display iOS Charts (MPAndroidChart) on an Apple Watch?


I have the iOS Charts framework installed and running on my iPhone. I was wondering if there was a way to display the charts from my iPhone to the Apple Watch.

How would I go about this?


Solution

  • I guess No, there is no class similar to UIView in WatchKit. I am not sure if watch os 2 support, you could take a look.

    But, you could try to generate images and transfer them to Watch App using WKInterfaceImage's func setImage(image: UIImage?)

    If you already have drawing code for drawing in -drawRect:, it shouldn't be that difficult to modify it to support drawing to image

    If you are just looking for some bars or lines chart, there are some libraries there, for instance, https://github.com/yasuoza/YOChartImageKit