0

I started to learn how to use iOS-charts-API from appcoda.com

I create a LineChart and I don't know how to enable a small pop-up, with the value of the selected entry. Here is two example picture what I am trying to implement: https://raw.githubusercontent.com/PhilJay/MPChart/master/screenshots/simpledesign_barchart3.png

linechart entry selected

If I tap on an entry I want to create a popup over it with its value. I implemented chartValueSelected function:

func chartValueSelected(chartView: ChartViewBase, entry: ChartDataEntry, dataSetIndex: Int, highlight: ChartHighlight){
print(entry.value)
print(highlight.xIndex)}

If I run this and tap on an entry, this code is working, so I can see the value on Console, but I think to create a pop-up is a built in function in the API, just I don't know what function should I call or property set.

1
  • Did you manage to get this working? If so, would you be able to add some code examples to your question of the working solution? Been attempting to do the same for a while with no avail Commented Apr 10, 2016 at 11:24

1 Answer 1

3

This popup can be implmented by ChartMarker. Check out ChartsDemo's code, there is a BalloonMarker to demonstrate.

You should walk through ChartMarker class to know what can be done, like directly using a UIImage.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.