Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
1
10php
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yu Kimiduka
10php
Commits
5e975caf
Commit
5e975caf
authored
Jul 14, 2016
by
君塚 悠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
プログラム作成(graph.php,graph_gen.php:グラフ生成)
parent
a9330410
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
graph.php
php/php10/day07-2/graph.php
+9
-0
graph_gen.php
php/php10/day07-2/graph_gen.php
+30
-0
No files found.
php/php10/day07-2/graph.php
0 → 100644
View file @
5e975caf
<html>
<head>
<title>
棒グラフの動的生成
</title>
</head>
<body>
<h1
style =
"background:#cccccc"
>
書籍売り上げ傾向 (2005年第一四半期)
</h1>
<img
src =
"graph_gen.php"
width =
"450"
height =
"250"
/>
</body>
</html>
php/php10/day07-2/graph_gen.php
0 → 100644
View file @
5e975caf
<?php
//JpGraphによる棒グラフの生成
require_once
(
"jpgraph/jpgraph.php"
);
require_once
(
"jpgraph/jpgraph_bar.php"
);
//グラフの基本設定
$objGrh
=
new
Graph
(
450
,
250
,
"auto"
);
$objGrh
->
SetScale
(
"textlin"
);
$objGrh
->
title
->
Set
(
"Books Trend"
);
$objGrh
->
xaxis
->
title
->
Set
(
"2005.4Q"
);
$objGrh
->
yaxis
->
title
->
Set
(
"Quantity"
);
//グラフのデータ設定
$data
=
array
(
array
(
350
,
200
,
280
),
array
(
295
,
150
,
290
),
array
(
295
,
150
,
290
),
array
(
315
,
180
,
220
));
$objPlot
[]
=
new
BarPlot
(
$data
[
0
]);
$objPlot
[]
=
new
BarPlot
(
$data
[
1
]);
$objPlot
[]
=
new
BarPlot
(
$data
[
2
]);
$objPlot
[
0
]
->
SetLegend
(
'PHP'
);
$objPlot
[
1
]
->
SetLegend
(
'ASP'
);
$objPlot
[
2
]
->
SetLegend
(
'ASP'
);
$objPlot
[
0
]
->
SetFillcolor
(
'red@0.7'
);
$objPlot
[
1
]
->
SetFillcolor
(
'blue@0.7'
);
$objPlot
[
2
]
->
SetFillcolor
(
'green@0.7'
);
//グラフの出力
$objGbp
=
new
GroupBarPlot
(
$objPlot
);
$objGbp
->
SetWidth
(
0.90
);
$obpGrh
->
Add
(
$objGbp
);
$objGrh
->
Stroke
();
?>
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