Draw custom charts in watchOS

Draw custom charts in watchOS

Source code introduction: watchOS does not have a UIView class, so YOChartImageKit is used to implement drawing UIImage for charts of custom values.

You can draw line charts, bar charts, doughnut charts, etc., and you can adjust the display options for each.

Source code effect:

Source code snippet:

  1. let image = YOLineChartImage()
  2. image.strokeWidth = 4.0                // width of line  
  3. image.strokeColor = randomColor() // color of line  
  4. image.values ​​= [ 0.0 , 1.0 , 2.0 ] // chart values  
  5. image.smooth = false                   // disable smooth line  
  6. image.drawImage(frame, scale: scale) // draw an image  

Download address: http://download..com/data/2070668

<<:  E-commerce platform HighstreetWatchApp

>>:  Apple's R&D spending exceeds $2 billion for the first time. How much of it went to programmers?

Recommend

Brand marketing planning basics

What I want to share today is market research. Be...

The victory of "beating" Cook and the mediocre people are complacent about

[[149617]] Five years have passed. Jobs' tomb...

There are 100 ways to gain followers on WeChat. Which ones have you learned?

People often ask me how to add people. Here is a ...

After the stock price soared, is Thunder Wanke Coin really a scam?

Recently, something extraordinary seems to have h...

How to acquire customers through low-cost fission? Share 7 techniques

Since 2017, online traffic has become more and mo...

Spending the Winter Solstice on Mars? It Did!

The northern hemisphere of Mars, where the Zhuron...

How much does it cost to make a wine utensils mini program in Bayanzhuoer?

There is no doubt that the topic of mini programs...