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

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

Closed
samarth220194 opened this issue Jun 24, 2017 · 2 comments
Closed

Comments

@samarth220194
Copy link

samarth220194 commented Jun 24, 2017

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

@liuxuan30
Copy link
Member

liuxuan30 commented Jun 26, 2017

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
    }

@ibrahimzak
Copy link

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

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

3 participants