Skip to content

Commit

Permalink
Merge pull request #3854 from chaaarly/master
Browse files Browse the repository at this point in the history
HorizontalBarChar value label offset calculation
  • Loading branch information
liuxuan30 authored Mar 20, 2019
2 parents b1df472 + d096474 commit 5d0b99a
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 @@ -388,7 +388,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 5d0b99a

Please sign in to comment.