File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
WordPress/Classes/ViewRelated/Stats/Insights/ViewsVisitors Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -249,7 +249,8 @@ final class ViewsVisitorsChartMarker: MarkerView {
249
249
}
250
250
251
251
let entryPrevWeek = lineChartDataSetPrevWeek. entries [ Int ( entry. x) ]
252
- let difference = entry. y - entryPrevWeek. y
252
+ let difference = Int ( entry. y - entryPrevWeek. y)
253
+ let differenceStr = difference < 0 ? " \( difference) " : " + \( difference) "
253
254
254
255
var roundedPercentage = 0
255
256
if entryPrevWeek. y > 0 {
@@ -264,7 +265,7 @@ final class ViewsVisitorsChartMarker: MarkerView {
264
265
. paragraphStyle: paragraphStyle,
265
266
. foregroundColor: UIColor . white]
266
267
267
- let topRowStr = NSMutableAttributedString ( string: " \( Int ( difference ) ) ( \( roundedPercentage) %) \n " , attributes: topRowAttributes)
268
+ let topRowStr = NSMutableAttributedString ( string: " \( differenceStr ) ( \( roundedPercentage) %) \n " , attributes: topRowAttributes)
268
269
let bottomRowStr = NSAttributedString ( string: " \( yValue) \( name) " , attributes: bottomRowAttributes)
269
270
270
271
topRowStr. append ( bottomRowStr)
You can’t perform that action at this time.
0 commit comments