You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation markup in ValueFormatter says, 'override the getFormattedValue(...) method' but there's no such method in the library.
Is this a bug and it's missing or is the documentation wrong?
import Foundation
/// Interface that allows custom formatting of all values inside the chart before they are being drawn to the screen.
///
/// Simply create your own formatting class and let it implement ValueFormatter.
///
/// Then override the getFormattedValue(...) method and return whatever you want.
@objc(ChartValueFormatter)
public protocol ValueFormatter: class
{
/// Called when a value (from labels inside the chart) is formatted before being drawn.
///
/// For performance reasons, avoid excessive calculations and memory allocations inside this method.
///
/// - returns: The formatted label ready for being drawn
///
/// - parameter value: The value to be formatted
///
/// - parameter axis: The entry the value belongs to - in e.g. BarChart, this is of class BarEntry
///
/// - parameter dataSetIndex: The index of the DataSet the entry in focus belongs to
///
/// - parameter viewPortHandler: provides information about the current chart state (scale, translation, ...)
///
func stringForValue(_ value: Double,
entry: ChartDataEntry,
dataSetIndex: Int,
viewPortHandler: ViewPortHandler?) -> String
}
The text was updated successfully, but these errors were encountered:
Yes, I'll file a PR. I wanted to make sure I wasn't missing something before making any changes.
There are so many questions about formatting axis labels as something other than an index value it would be very helpful if the documentation described how to do it and gave examples. Yes, I know some of the demos do it but there's a lot going on to render the axes and their labels so it difficult to understand what it's actually doing. I've stepped through the code countless times and still not sure how it really does it. Less experienced developers like myself would really benefit from this.
The documentation markup in ValueFormatter says, 'override the getFormattedValue(...) method' but there's no such method in the library.
Is this a bug and it's missing or is the documentation wrong?
The text was updated successfully, but these errors were encountered: