Skip to content

Commit

Permalink
Improve HorizontalBarChart offset calculation for negative value labe…
Browse files Browse the repository at this point in the history
…ls (Fixes #3850)
  • Loading branch information
charliestg committed Feb 20, 2019
1 parent cf36285 commit d096474
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Charts/Renderers/HorizontalBarChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ open class HorizontalBarChartRenderer: BarChartRenderer
// calculate the correct offset depending on the draw position of the value
let valueTextWidth = valueText.size(withAttributes: [NSAttributedString.Key.font: valueFont]).width
posOffset = (drawValueAboveBar ? valueOffsetPlus : -(valueTextWidth + valueOffsetPlus))
negOffset = (drawValueAboveBar ? -(valueTextWidth + valueOffsetPlus) : valueOffsetPlus)
negOffset = (drawValueAboveBar ? -(valueTextWidth + valueOffsetPlus) : valueOffsetPlus) - rect.size.width

if isInverted
{
Expand Down

0 comments on commit d096474

Please sign in to comment.