Skip to content

Added logic to be able to customise the Font Name, Font Color or Font Size on both the Bar Graph and Line Graph #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions GraphKit/Example/ExampleBarGraphVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ - (void)viewDidLoad {
// self.graphView.barHeight = 140;
// self.graphView.marginBar = 25;
// self.graphView.animationDuration = 2.0;

// Added Ability to customise the Font Color, Font Size or Font Name
// [self.graphView setCustomFontName:@"Gotham-Book"];
// [self.graphView setCustomFontColor:[UIColor redColor]];

self.graphView.dataSource = self;

Expand Down
10 changes: 9 additions & 1 deletion GraphKit/Example/ExampleLineGraph.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,21 @@ - (void)_setupExampleGraph {
// @[@620, @650, @580, @620, @540, @400, @0]
];

self.labels = @[@"2001", @"2002", @"2003", @"2004", @"2005", @"2006", @"2007"];
self.labels = @[@"2001", @"", @"", @"2004", @"", @"", @"2007"];

self.graph.dataSource = self;
self.graph.lineWidth = 3.0;

self.graph.valueLabelCount = 6;

// Added Ability to customise the Font Color, Font Size or Font Name
// [self.graph setXAxisCustomFontName:@"Gotham-Book"];
// [self.graph setYAxisCustomFontName:@"Arial-ItalicMT"];
// [self.graph setXAxisCustomFontColor:[UIColor redColor]];
// [self.graph setYAxisCustomFontColor:[UIColor purpleColor]];
// [self.graph setXAxisCustomFontSize:6];
// [self.graph setYAxisCustomFontSize:10];

[self.graph draw];
}

Expand Down
2 changes: 1 addition & 1 deletion GraphKit/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ SPEC CHECKSUMS:
FrameAccessor: 5eec95b29b5e9a3afe72a7a2e9ed25b000d3bcc3
MKFoundationKit: 4858fe474ee45f988db5ff1e229d700743e71ed8

COCOAPODS: 0.34.1
COCOAPODS: 0.35.0
2 changes: 1 addition & 1 deletion GraphKit/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading