借助UIProgressBar
中UITableView
的帮助,我可以通过per获得水平条形图的视图,
当前输出
//TEST DATA:
arrShareNames = ["Infosys","TCS","Reliance","Wipro"]
arrSharepercent = [30,40,21,10]
if let progressView = self.view.viewWithTag(101) as? UIProgressView {
progressView.progress = 0.0
progressView.progress = Float(arrSharepercent[indexPath.row]/100)
progressView.progressViewStyle = UIProgressViewStyle.bar
progressView.transform = CGAffineTransform(rotationAngle: CGFloat(-Double.pi));
}
我要在图表的每个条形旁边添加百分比值,如下所示:
所需的输出
我们如何在进度条的末尾添加进度百分比标签?