Skip to content

Commit

Permalink
add fix for horizontal bar chart
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxuan30 committed Jul 27, 2015
1 parent 2f75778 commit c861fea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Charts/Classes/Renderers/HorizontalBarChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public class HorizontalBarChartRenderer: BarChartRenderer
var e = entries[j]

// calculate the x-position, depending on datasetcount
var x = CGFloat(e.xIndex + j * dataSetOffset) + CGFloat(index)
+ groupSpace * CGFloat(j) + groupSpaceHalf
var x = CGFloat(e.xIndex + e.xIndex * dataSetOffset) + CGFloat(index)
+ groupSpace * CGFloat(e.xIndex) + groupSpaceHalf
var vals = e.values

if (!containsStacks || vals == nil)
Expand Down
2 changes: 1 addition & 1 deletion Charts/Classes/Utils/ChartTransformer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public class ChartTransformer: NSObject
var e = entries[j]

// calculate the x-position, depending on datasetcount
var x = CGFloat(e.xIndex + (j * (setCount - 1)) + dataSet) + space * CGFloat(j) + space / 2.0
var x = CGFloat(e.xIndex + (e.xIndex * (setCount - 1)) + dataSet) + space * CGFloat(e.xIndex) + space / 2.0
var y = e.value

valuePoints.append(CGPoint(x: CGFloat(y) * phaseY, y: x))
Expand Down

0 comments on commit c861fea

Please sign in to comment.