I need to draw grid lines (on line chart) only below the data. I couldn't find an API for it, yet.
Here I drew something showing what I get and what I need:
Top drawing is what I get. Below is what I need. Sorry for awful drawing talent :)
Any suggestions? Thank you.
Another way. Use fillFormatter
to fill the area where you don't want to see grid lines.
I check this code snippet with ChartsDemo-iOS-Swift example. In class LineChart1ViewController
I changed part of setDataCount()
function. I specifically used white
color, so you can see the filled area.
//...
set1.fillAlpha = 1
set1.drawFilledEnabled = true
set1.fillColor = .white
set1.fillFormatter = DefaultFillFormatter { _,_ -> CGFloat in
return CGFloat(self.chartView.leftAxis.axisMaximum)
}
//...
Result
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With