Toggle navigation
Toggle navigation
This project
Loading...
Sign in
iOS
/
PNChart
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
dullgrass
2015-05-15 14:11:36 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6f8b55f4ec5d47ba108d3c0111f8a33fc146f3fd
6f8b55f4
1 parent
13f1024f
FixBug: BarChart Show Wrong Numbers
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
PNChart/PNBar.m
PNChartDemo/PCChartViewController.m
PNChart/PNBar.m
View file @
6f8b55f
...
...
@@ -39,8 +39,8 @@
-
(
void
)
setGrade
:(
float
)
grade
{
NSLog
(
@"New garde %f"
,
grade
);
//
NSLog(@"New garde %f",grade);
CGFloat
startPosY
=
(
1
-
grade
)
*
self
.
frame
.
size
.
height
;
UIBezierPath
*
progressline
=
[
UIBezierPath
bezierPath
];
...
...
@@ -201,8 +201,8 @@
[
_chartLine
addSublayer
:
self
.
textLayer
];
[
self
.
textLayer
setFontSize
:
textheigt
/
2
];
[
self
.
textLayer
setString
:[[
NSString
alloc
]
initWithFormat
:
@"%
ld"
,(
NSInteger
)(
grade
*
100
)
]];
[
self
.
textLayer
setString
:[[
NSString
alloc
]
initWithFormat
:
@"%
0.f"
,
grade
*
100
]];
[
self
.
textLayer
setFrame
:
CGRectMake
(
0
,
textStartPosY
,
textWidth
,
textheigt
)];
self
.
textLayer
.
contentsScale
=
[
UIScreen
mainScreen
].
scale
;
...
...
PNChartDemo/PCChartViewController.m
View file @
6f8b55f
...
...
@@ -103,7 +103,12 @@
self
.
barChart
.
labelMarginTop
=
5
.
0
;
[
self
.
barChart
setXLabels
:@[
@"SEP 1"
,
@"SEP 2"
,
@"SEP 3"
,
@"SEP 4"
,
@"SEP 5"
,
@"SEP 6"
,
@"SEP 7"
]];
self
.
barChart
.
rotateForXAxisText
=
true
;
self
.
barChart
.
yLabelSum
=
5
;
self
.
barChart
.
yMaxValue
=
100
;
[
self
.
barChart
setYValues
:@[
@1
,
@24
,
@12
,
@18
,
@30
,
@10
,
@21
]];
// self.barChart.yLabels = @[@0,@20,@40,@60];
[
self
.
barChart
setStrokeColors
:@[
PNGreen
,
PNGreen
,
PNRed
,
PNGreen
,
PNGreen
,
PNYellow
,
PNGreen
]];
// Adding gradient
self
.
barChart
.
barColorGradientStart
=
[
UIColor
blueColor
];
...
...
Please
register
or
login
to post a comment