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

custom string value at top of bar. #1109

Closed
cuddle-sujeet opened this issue Jun 6, 2016 · 4 comments
Closed

custom string value at top of bar. #1109

cuddle-sujeet opened this issue Jun 6, 2016 · 4 comments

Comments

@cuddle-sujeet
Copy link

I have gone through the issue: How to let the Y axis shows is not only a number, but the custom string #1003
whose solution states that I should set valueFormatter in ChartDataSet.
My Problem is that I need to set the values on top of these bar with a custom stringvalue coming from webService. From the implementation I see that the value formatter is being applied to the "values" of the chartDataEntry.

Can't we some how use the DataValue as provided in the chartDataEntry init method.
BarChartDataEntry(value: value, xIndex: index, data: displayValue)

I need to set this "displayValue" on top the barChart.

@cuddle-sujeet
Copy link
Author

Also I have noticed that the same can be done in android as the CustomerFormatter.

String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) .

where the formatter has the access to the "entry" which is same as the "data" in swift method BarChartDataEntry(value: value, xIndex: index, data: displayValue).

@arjenbolten
Copy link

Did you manage to solve it?
I have the same problem

@cuddle-sujeet
Copy link
Author

@arjenbolten No ..had to move to other alternative, I am using the ChartMarker to show the information as bubbles on top of it.

@liuxuan30
Copy link
Member

Just use dataSet.valueFormatter in Chart 3.0. it's more flexible now.

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