0

HorizontalBarChartView有一个阴影。我怎样才能删除它?

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

4

2 回答 2

0

如果您使用的是 swift 而不是 objc,只需将 'NO' 替换为 '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 示例链接中

//: ### General
chartView.pinchZoomEnabled          = false
chartView.drawBarShadowEnabled      = false
chartView.doubleTapToZoomEnabled    = false
chartView.drawGridBackgroundEnabled = true
chartView.fitBars                   = true
于 2018-01-10T10:16:22.557 回答
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)
于 2015-08-22T02:06:47.467 回答