Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getFillLinePosition not calling to create Area graph #1427

Closed
anishparajuli555 opened this issue Sep 11, 2016 · 1 comment
Closed

getFillLinePosition not calling to create Area graph #1427

anishparajuli555 opened this issue Sep 11, 2016 · 1 comment

Comments

@anishparajuli555
Copy link

i am trying to create an area graph. I subclassed ChartFillFormatter...But getFillLinePosition method is not calling??

public class BottomLineFillFormatter: NSObject, ChartFillFormatter
{
    private let chartView: LineChartView!
    init(chartViewInit: LineChartView) {
        chartView = chartViewInit
        super.init()
    }

    public func getFillLinePosition(dataSet dataSet: ILineChartDataSet, dataProvider: LineChartDataProvider) -> CGFloat{
        return CGFloat(chartView.leftAxis._axisMaximum)   
    }
}

My code to fill the line graph is as:

 let set3: LineChartDataSet = LineChartDataSet(yVals: yVals3, label:nil)
        set3.axisDependency = .Left // Line will correlate with left axis values
        set3.setColor(UIColor.grayColor().colorWithAlphaComponent(1.0))
        set3.lineWidth = 2.0
        set3.fillColor = UIColor.grayColor()
        set3.drawCirclesEnabled = false
        set3.fillFormatter = BottomLineFillFormatter(chartViewInit: lineChart)
@anishparajuli555
Copy link
Author

I just need to set

set2.drawFilledEnabled = true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant