Charts: How to add X axis values in the balloon marker view in IOS Charts?

Created on 24 Jun 2017  路  2Comments  路  Source: danielgindi/Charts

I am able to show the y-axis values on the marker view, but how to show the x-axis values in it. This is the code which I have used to show y-axis values. I used the refreshContent method of balloon marker view to show the x axis values , but it is still not working.

let marker:BalloonMarker = BalloonMarker(color: UIColor.white, font: UIFont(name: "Helvetica", size: 10)!, textColor: UIColor.black, insets: UIEdgeInsets(top: 2.0, left: 3.0, bottom: 2.0, right: 3.0)) marker.arrowSize = CGSize(width : 5.0, height : 8.0) marker.minimumSize = CGSize(width : 50.0, height : 25.0) lineChartView.marker?.refreshContent(entry: DataEntry, highlight: Highlight(x : Double(i) , y : Values[i] , dataSetIndex : i)) lineChartView.marker = marker

This is the screenshot

rh2gl

Most helpful comment

That's because balloon marker only show y value... You need to provide your own marker to show other values...

    open override func refreshContent(entry: ChartDataEntry, highlight: Highlight)
    {
        setLabel(String(entry.y))  // change to x
    }

All 2 comments

That's because balloon marker only show y value... You need to provide your own marker to show other values...

    open override func refreshContent(entry: ChartDataEntry, highlight: Highlight)
    {
        setLabel(String(entry.y))  // change to x
    }

how to add the name of the entry description instead of the x or y value?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

heumn picture heumn  路  3Comments

coop44483 picture coop44483  路  3Comments

ahmedsafadii picture ahmedsafadii  路  3Comments

JW00332 picture JW00332  路  4Comments

deepumukundan picture deepumukundan  路  3Comments