Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
万
万科
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
万科
Commits
6993c6f4
Commit
6993c6f4
authored
Feb 17, 2016
by
Achilles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客流详情界面并状图bug.
parent
dc98caef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
20 deletions
+15
-20
VankeBusinessChartCell_iPhone.m
...ne/templates/floor-detail/VankeBusinessChartCell_iPhone.m
+10
-15
VankePassengerDetailBoard_iPhone.m
...templates/floor-detail/VankePassengerDetailBoard_iPhone.m
+5
-5
No files found.
vanke/view_iPhone/templates/floor-detail/VankeBusinessChartCell_iPhone.m
View file @
6993c6f4
...
...
@@ -5,25 +5,25 @@
#import "VankeBusinessChartCell_iPhone.h"
#define CHART_DIAMETER 200
#define COLOR_R 90
#define COLOR_G 60
#define COLOR_B 30
#pragma mark -
@implementation
VankeBusinessChartCell_iPhone
PNPieChart
*
chartPieChart
;
NSArray
*
chartColors
;
SUPPORT_AUTOMATIC_LAYOUT
(
YES
)
SUPPORT_RESOURCE_LOADING
(
YES
)
-
(
void
)
load
{
[
self
initChartColors
];
}
-
(
void
)
unload
{
chartColors
=
nil
;
chartPieChart
=
nil
;
}
...
...
@@ -46,14 +46,13 @@ SUPPORT_RESOURCE_LOADING( YES )
}
}
-
(
void
)
layoutDidFinish
{
[
self
drawPieChart
];
}
-
(
void
)
drawPieChart
{
chartPieChart
=
[[
PNPieChart
alloc
]
initWithFrame
:
CGRectMake
((
self
.
width
-
CHART_DIAMETER
)
/
2
.
0
,
0
,
CHART_DIAMETER
,
CHART_DIAMETER
)
items
:[
self
getChartItems
]];
chartPieChart
=
[[
PNPieChart
alloc
]
initWithFrame
:
CGRectMake
((
self
.
width
-
CHART_DIAMETER
)
/
2
.
0
+
20
,
0
,
CHART_DIAMETER
,
CHART_DIAMETER
)
items
:[
self
getChartItems
]];
chartPieChart
.
descriptionTextColor
=
[
UIColor
blackColor
];
chartPieChart
.
descriptionTextFont
=
[
UIFont
fontWithName
:
@"微软雅黑"
size
:
12
.
0
];
chartPieChart
.
descriptionTextShadowColor
=
[
UIColor
clearColor
];
...
...
@@ -74,22 +73,18 @@ SUPPORT_RESOURCE_LOADING( YES )
-
(
NSArray
*
)
getChartItems
{
ChartValue
*
data
=
self
.
data
;
NSInteger
colorLen
=
[
chartColors
count
];
for
(
NSInteger
i
=
0
;
i
<
[
data
.
values
count
];
++
i
)
{
PNPieChartDataItem
*
item
=
[
data
.
values
objectAtIndex
:
i
];
item
.
color
=
[
chartColors
objectAtIndex
:
i
%
colorLen
];
item
.
color
=
[
self
randomColor
:
i
];
}
// [data.values enumerateObjectsUsingBlock:^(ProjectSaleVolume *obj, NSUInteger idx, BOOL * _Nonnull stop) {
// UIColor *color = [chartColors objectAtIndex:idx % colorLen];
// float itemValue = [obj.amount floatValue];
// NSString *itemDesc = obj.dimensionValue;
// [items addObject:[PNPieChartDataItem dataItemWithValue:itemValue color:color description:itemDesc]];
// }];
return
data
.
values
;
}
-
(
void
)
initChartColors
{
chartColors
=
@[
PNYellow
,
PNBlue
,
PNTwitterColor
,
PNPinkDark
,
PNGreen
,
PNTitleColor
,
PNLightGreen
,
PNFreshGreen
,
PNDeepGreen
,
PNRed
,
PNMauve
,
PNBrown
,
PNStarYellow
,
PNDarkBlue
,
PNDeepGrey
,
PNPinkGrey
,
PNLightGrey
,
PNCleanGrey
,
PNDarkYellow
,
PNCloudWhite
,
PNLightBlue
,
PNBlack
,
PNiOSGreenColor
];
-
(
UIColor
*
)
randomColor
:
(
NSInteger
)
i
{
CGFloat
r
=
((
COLOR_R
*
i
+
20
)
%
255
)
/
255
.
0
;
CGFloat
g
=
((
COLOR_G
*
i
+
180
)
%
255
)
/
255
.
0
;
CGFloat
b
=
((
COLOR_B
*
i
+
35
)
%
255
)
/
255
.
0
;
return
[
UIColor
colorWithRed
:
r
green
:
g
blue
:
b
alpha
:
1
.
0
f
];
}
@end
...
...
vanke/view_iPhone/templates/floor-detail/VankePassengerDetailBoard_iPhone.m
View file @
6993c6f4
...
...
@@ -66,10 +66,10 @@ ON_CREATE_VIEWS( signal )
self
.
list
.
whenReloading
=
^
{
NSInteger
chartTotal
=
0
;
PassengerFlowResponse
*
resp
=
[
_passengerFlowModel
getServerResp
];
if
(
nil
!=
resp
)
{
chartTotal
=
[
resp
dataCount
];
NSInteger
chartTotal
=
0
;
if
(
nil
!=
resp
&&
[
resp
dataCount
]
>
0
)
{
chartTotal
=
1
;
}
self
.
list
.
total
=
1
+
chartTotal
;
...
...
@@ -80,8 +80,8 @@ ON_CREATE_VIEWS( signal )
photo
.
order
=
0
;
photo
.
size
=
CGSizeMake
(
0
,
230
);
for
(
int
i
=
0
;
i
<
chartTotal
;
++
i
)
{
BeeUIScrollItem
*
bizChart
=
self
.
list
.
items
[
i
+
1
];
if
(
chartTotal
>
0
)
{
BeeUIScrollItem
*
bizChart
=
self
.
list
.
items
[
1
];
bizChart
.
clazz
=
[
VankeBusinessChartCell_iPhone
class
];
// 取值
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment