From 50805d1f6053b8299c8e70e899d1165f8baee9b8 Mon Sep 17 00:00:00 2001 From: Jim Date: Wed, 13 Jun 2018 06:33:23 -0700 Subject: [PATCH 1/2] Removes comment about non-existent method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IValueFormatter had a comment suggesting that you can override the getFormattedValue(…) method but that method doesn’t exist. The comment has been removed. --- Source/Charts/Formatters/IValueFormatter.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Charts/Formatters/IValueFormatter.swift b/Source/Charts/Formatters/IValueFormatter.swift index bd7c0c90f8..e463accf9a 100644 --- a/Source/Charts/Formatters/IValueFormatter.swift +++ b/Source/Charts/Formatters/IValueFormatter.swift @@ -15,7 +15,7 @@ import Foundation /// /// Simply create your own formatting class and let it implement ValueFormatter. /// -/// Then override the getFormattedValue(...) method and return whatever you want. + @objc(IChartValueFormatter) public protocol IValueFormatter: class { From e1f3b713bdd2601b0169ed0db913b823d65bdd72 Mon Sep 17 00:00:00 2001 From: Jim Date: Thu, 14 Jun 2018 13:32:17 -0700 Subject: [PATCH 2/2] Update code comment to reference stringForValue() Adding back the comment but revised it to refer to the stringForValue() method in the IValueFormatter protocol. I know, I know, it should have been obvious but @philfi had to point it out to me. --- Source/Charts/Formatters/IValueFormatter.swift | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Source/Charts/Formatters/IValueFormatter.swift b/Source/Charts/Formatters/IValueFormatter.swift index e463accf9a..5aae95b2a1 100644 --- a/Source/Charts/Formatters/IValueFormatter.swift +++ b/Source/Charts/Formatters/IValueFormatter.swift @@ -11,10 +11,10 @@ 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. +/// Interface that allows custom formatting of all values inside the chart before they are drawn to the screen. /// +/// Simply create your own formatting class and let it implement ValueFormatter. Then override the stringForValue() +/// method and return whatever you want. @objc(IChartValueFormatter) public protocol IValueFormatter: class @@ -24,12 +24,10 @@ public protocol IValueFormatter: class /// /// For performance reasons, avoid excessive calculations and memory allocations inside this method. /// - /// - returns: The formatted label ready for being drawn + /// - returns: The formatted label ready to be 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, ...)