Iso-chart BarChart with rounded corners

Is there a setting in BarChartView to include rounded corners for columns?

I want to achieve a similar effect for this other iosbarchart library enter image description here

+3


source to share


1 answer


I made a fork of the ios-chart to accomplish this: https://github.com/mcconkiee/ios-charts



var yVals: [BarChartDataEntry] = []
                var xVals: [String] = []
                var dataCount = sections.count
                for i in 0...(dataCount - 1) {
                    var dataObjectInstance = sections[i] as SomeCustomDataObject
                    var entry = BarChartDataEntry(value: dataObjectInstance.numeric!, xIndex: i)
                    entry.rounded = true //make the end caps round!
                    if let tintClr = dataObjectInstance.tint as String?{
                        if let clr = UIColor(hexString: tintClr) as UIColor?{
                            entry.tint = clr
                        }
                    }
                    yVals.append(entry)
                    var time = i % 12
                    if(time == 0) {
                        time = 12
                    }
                    if let objVal = dataObjectInstance.objectValue as String?{
                        xVals.append(objVal)
                    }

                }

      

+2


source







All Articles