ChartsOrg / Charts

Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart.
Apache License 2.0
27.51k stars 5.99k forks source link

Format the Y-axis scale values anxious anxious anxious #4515

Open qq1341738311 opened 3 years ago

qq1341738311 commented 3 years ago

4.0 latest version of Charts Question: This chart is a MPAndroidChart ported to Android. MPAndroidChart has a method public String getFormattedValue(float value, AxisBase axis) {} This can get the automatically generated Y-axis scale value, and then it is very convenient to solve the scale formatting (for example: 20000.22 converted into 2.2万) Is there a similar method for Charts in iOS? Thanks, very anxious

4.0最新版本的Charts 问题:这个charts是移植的那个安卓的,MPAndroidChart这个三方, MPAndroidChart有方法public String getFormattedValue(float value, AxisBase axis) {} 可以拿到自动生成的Y轴的刻度值,然后很方便的解决刻度格式化(例如:20000.22转成2.2万) iOS 的Charts有类似方法吗? 谢谢,很着急

qq1341738311 commented 3 years ago

4.0 latest version of Charts Question: This chart is a MPAndroidChart ported to Android. MPAndroidChart has a method public String getFormattedValue(float value, AxisBase axis) {} This can get the automatically generated Y-axis scale value, and then it is very convenient to solve the scale formatting (for example: 20000.22 converted into 2.2万) Is there a similar method for Charts in iOS? Thanks, very anxious

maslovsa commented 3 years ago

Try custom Formatter Like this https://stackoverflow.com/a/45362863/2706934

NB: check comments about 1B+ values

liunianhuaguoyanxi commented 3 years ago

请问楼主后续怎么处理的呢