从Horizo​​ntalBarChartView中删除阴影

时间:2015-08-20 14:46:59

标签: ios-charts

我的HorizontalBarChartView有一个投影。我该如何删除它?

图表设置如下: chartView.userInteractionEnabled = NO; chartView.drawGridBackgroundEnabled = NO; chartView.drawBarShadowEnabled = NO; chartView.drawBordersEnabled = NO; chartView.leftAxis.enabled = NO; chartView.rightAxis.enabled = NO; chartView.drawValueAboveBarEnabled = NO;

2 个答案:

答案 0 :(得分:0)

尝试停用BarChartView.drawBarShadowEnabled

BarChartDataSet中也有shadowColor:

/// the color used for drawing the bar-shadows. The bar shadows is a surface behind the bar that indicates the maximum value
public var barShadowColor = UIColor(red: 215.0/255.0, green: 215.0/255.0, blue: 215.0/255.0, alpha: 1.0)

答案 1 :(得分:0)

如果您使用的是swift而不是objc,只需更换“否”即可。通过' false'

chartView.drawBarShadowEnabled = false

编辑: 来自代码来源:

/// if set to true, a grey area is drawn behind each bar that indicates the maximum value
173     @objc open var drawBarShadowEnabled: Bool 

在ChartsDemo示例link

//: ### General
chartView.pinchZoomEnabled          = false
chartView.drawBarShadowEnabled      = false
chartView.doubleTapToZoomEnabled    = false
chartView.drawGridBackgroundEnabled = true
chartView.fitBars                   = true