Skip to content

Commit b68489b

Browse files
author
Francesco Leoni
authored
Merge pull request #22 from mahonya/setMargitDefault
Reset default margins
2 parents 3dc354e + 2f3daaa commit b68489b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Sources/FLCharts/FLCartesianPlane.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ public class FLCartesianPlane: UIView, FLStylable {
121121
context.saveGState()
122122

123123
labels.labels.removeAll()
124+
125+
config.setMarginDefault()
124126

125127
guard dataMaxValue > 0 else {
126128
drawNoDataLabel()

Sources/FLCharts/Models/Configurations/FLChartConfig.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ public class FLChartConfig {
8787
func setMarginBottom(to value: CGFloat) {
8888
margin.bottom += value
8989
}
90+
91+
func setMarginDefault(){
92+
margin.top = 5
93+
margin.left = 45
94+
margin.botton = 25
95+
margin.right = 0
96+
}
9097

9198
func setMargin(for yPosition: YPosition, horizontalMargin: CGFloat) {
9299
switch yPosition {

0 commit comments

Comments
 (0)