Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
S
sidekick
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Privat - Marco Schmiedel
sidekick
Commits
87c777df
Commit
87c777df
authored
Aug 01, 2022
by
Kevin Yumang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SERV-2286 - refactor structure of chart data manager objects
parent
e0962a92
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
92 additions
and
116 deletions
+92
-116
ChartDataManager.php
src/Managers/ChartManager/ChartDataManager.php
+0
-4
ISeriesData.php
src/Managers/ChartManager/ISeriesData.php
+0
-1
LineSeriesData.php
src/Managers/ChartManager/LineSeriesData.php
+0
-92
SeriesData.php
src/Managers/ChartManager/SeriesData.php
+1
-17
BarChartData.php
src/Views/Limitless/Barchart/Attachments/BarChartData.php
+6
-0
BarSeriesData.php
src/Views/Limitless/Barchart/Attachments/BarSeriesData.php
+34
-0
LineChartData.php
src/Views/Limitless/Linechart/Attachments/LineChartData.php
+6
-0
LineSeriesData.php
src/Views/Limitless/Linechart/Attachments/LineSeriesData.php
+42
-0
PieChartData.php
src/Views/Limitless/Piechart/Attachments/PieChartData.php
+0
-1
PieSeriesData.php
src/Views/Limitless/Piechart/Attachments/PieSeriesData.php
+3
-1
No files found.
src/Managers/ChartManager/ChartDataManager.php
View file @
87c777df
...
...
@@ -30,10 +30,6 @@ Class ChartDataManager {
$this
->
markLine
=
null
;
}
public
static
function
getSeriesDataInstance
()
:
ISeriesData
{
return
new
SeriesData
();
}
public
function
setTitle
(
string
$value
)
{
...
...
src/Managers/ChartManager/ISeriesData.php
View file @
87c777df
...
...
@@ -4,5 +4,4 @@ namespace Ceetrox\Managers\ChartManager;
interface
ISeriesData
{
public
function
getIndex
()
:
int
;
public
function
toArray
()
:
array
;
}
src/Managers/ChartManager/LineSeriesData.php
deleted
100644 → 0
View file @
e0962a92
<?php
namespace
Ceetrox\Managers\ChartManager
;
class
LineSeriesData
implements
ISeriesData
{
private
string
$name
;
private
array
$categoryValues
;
private
int
$index
;
private
?
string
$type
;
private
?
string
$stackName
;
private
?
bool
$showPointValues
;
private
?
bool
$isArea
;
private
?
string
$markLine
;
public
function
__construct
()
{
$this
->
categoryValues
=
[];
$this
->
index
=
0
;
$this
->
type
=
null
;
$this
->
stackName
=
null
;
$this
->
showPointValues
=
null
;
$this
->
isArea
=
null
;
$this
->
markLine
=
null
;
}
public
function
getIndex
()
:
int
{
return
$this
->
index
;
}
public
function
setName
(
string
$name
)
{
$this
->
name
=
$name
;
}
public
function
setCategoryValues
(
$values
)
{
if
(
is_array
(
$values
))
{
$this
->
categoryValues
=
array_merge
(
$this
->
categoryValues
,
$values
);
}
else
{
$this
->
categoryValues
[]
=
$values
;
}
}
public
function
setIndex
(
int
$index
)
{
$this
->
index
=
$index
;
}
public
function
setType
(
string
$value
)
{
$this
->
type
=
$value
;
}
public
function
setStackName
(
string
$value
)
{
$this
->
stackName
=
$value
;
}
public
function
setShowPointValues
(
bool
$value
)
{
$this
->
showPointValues
=
$value
;
}
public
function
setIsArea
(
bool
$value
)
{
$this
->
isArea
=
$value
;
}
public
function
setMarkLine
(
string
$value
)
{
$this
->
markLine
=
$value
;
}
public
function
toArray
()
:
array
{
$data
=
[];
$data
[
'name'
]
=
$this
->
name
;
$data
[
'data'
]
=
$this
->
categoryValues
;
$data
[
'index'
]
=
$this
->
index
;
if
(
!
is_null
(
$this
->
type
))
$data
[
'type'
]
=
$this
->
type
;
if
(
!
is_null
(
$this
->
stackName
))
$data
[
'stacked'
]
=
$this
->
stackName
;
if
(
!
is_null
(
$this
->
showPointValues
))
$data
[
'pointValues'
]
=
$this
->
showPointValues
;
if
(
!
is_null
(
$this
->
markLine
))
$data
[
'markLine'
]
=
$this
->
markLine
;
if
(
!
is_null
(
$this
->
isArea
))
$data
[
'isArea'
]
=
$this
->
isArea
;
return
$data
;
}
}
src/Managers/ChartManager/SeriesData.php
View file @
87c777df
...
...
@@ -8,8 +8,6 @@ class SeriesData implements ISeriesData
private
int
$index
;
private
?
string
$type
;
private
?
string
$stackName
;
private
?
bool
$showPointValues
;
private
?
bool
$isArea
;
private
?
string
$markLine
;
public
function
__construct
()
...
...
@@ -18,8 +16,6 @@ class SeriesData implements ISeriesData
$this
->
index
=
0
;
$this
->
type
=
null
;
$this
->
stackName
=
null
;
$this
->
showPointValues
=
null
;
$this
->
isArea
=
null
;
$this
->
markLine
=
null
;
}
...
...
@@ -57,22 +53,12 @@ class SeriesData implements ISeriesData
$this
->
stackName
=
$value
;
}
public
function
setShowPointValues
(
bool
$value
)
{
$this
->
showPointValues
=
$value
;
}
public
function
setIsArea
(
bool
$value
)
{
$this
->
isArea
=
$value
;
}
public
function
setMarkLine
(
string
$value
)
{
$this
->
markLine
=
$value
;
}
public
function
toArray
()
:
array
public
function
getParentData
()
:
array
{
$data
=
[];
...
...
@@ -82,9 +68,7 @@ class SeriesData implements ISeriesData
if
(
!
is_null
(
$this
->
type
))
$data
[
'type'
]
=
$this
->
type
;
if
(
!
is_null
(
$this
->
stackName
))
$data
[
'stacked'
]
=
$this
->
stackName
;
if
(
!
is_null
(
$this
->
showPointValues
))
$data
[
'pointValues'
]
=
$this
->
showPointValues
;
if
(
!
is_null
(
$this
->
markLine
))
$data
[
'markLine'
]
=
$this
->
markLine
;
if
(
!
is_null
(
$this
->
isArea
))
$data
[
'isArea'
]
=
$this
->
isArea
;
return
$data
;
}
...
...
src/Views/Limitless/Barchart/Attachments/BarChartData.php
View file @
87c777df
...
...
@@ -2,6 +2,7 @@
namespace
Ceetrox\Sidekick\Views\Limitless\Barchart\Attachments
;
use
Ceetrox\Managers\ChartManager\ChartDataManager
;
use
Ceetrox\Managers\ChartManager\ISeriesData
;
Class
BarChartData
extends
ChartDataManager
{
...
...
@@ -21,6 +22,11 @@ Class BarChartData extends ChartDataManager {
return
new
self
;
}
public
static
function
getSeriesDataInstance
()
:
ISeriesData
{
return
new
BarSeriesData
();
}
public
function
setIsHorizontal
(
bool
$value
)
{
$this
->
isHorizontal
=
$value
;
...
...
src/Views/Limitless/Barchart/Attachments/BarSeriesData.php
0 → 100644
View file @
87c777df
<?php
namespace
Ceetrox\Sidekick\Views\Limitless\Barchart\Attachments
;
use
Ceetrox\Managers\ChartManager\ISeriesData
;
use
Ceetrox\Managers\ChartManager\SeriesData
;
class
BarSeriesData
extends
SeriesData
implements
ISeriesData
{
private
?
bool
$showBarValues
;
public
function
__construct
()
{
parent
::
__construct
();
$this
->
showBarValues
=
null
;
}
public
function
setShowBarValues
(
bool
$value
)
{
$this
->
showBarValues
=
$value
;
}
public
function
toArray
()
:
array
{
$data
=
[];
if
(
!
is_null
(
$this
->
showBarValues
))
$data
[
'showBarValues'
]
=
$this
->
showBarValues
;
$data
=
array_merge
(
$data
,
$this
->
getParentData
());
return
$data
;
}
}
src/Views/Limitless/Linechart/Attachments/LineChartData.php
View file @
87c777df
...
...
@@ -2,6 +2,7 @@
namespace
Ceetrox\Sidekick\Views\Limitless\Linechart\Attachments
;
use
Ceetrox\Managers\ChartManager\ChartDataManager
;
use
Ceetrox\Managers\ChartManager\ISeriesData
;
Class
LineChartData
extends
ChartDataManager
{
...
...
@@ -31,6 +32,11 @@ Class LineChartData extends ChartDataManager {
return
new
self
;
}
public
static
function
getSeriesDataInstance
()
:
ISeriesData
{
return
new
LineSeriesData
();
}
public
function
setTitle
(
$value
)
{
if
(
is_array
(
$value
))
{
...
...
src/Views/Limitless/Linechart/Attachments/LineSeriesData.php
0 → 100644
View file @
87c777df
<?php
namespace
Ceetrox\Sidekick\Views\Limitless\Linechart\Attachments
;
use
Ceetrox\Managers\ChartManager\ISeriesData
;
use
Ceetrox\Managers\ChartManager\SeriesData
;
class
LineSeriesData
extends
SeriesData
implements
ISeriesData
{
private
?
bool
$showPointValues
;
private
?
bool
$isArea
;
public
function
__construct
()
{
parent
::
__construct
();
$this
->
showPointValues
=
null
;
$this
->
isArea
=
null
;
}
public
function
setShowPointValues
(
bool
$value
)
{
$this
->
showPointValues
=
$value
;
}
public
function
setIsArea
(
bool
$value
)
{
$this
->
isArea
=
$value
;
}
public
function
toArray
()
:
array
{
$data
=
[];
if
(
!
is_null
(
$this
->
showPointValues
))
$data
[
'pointValues'
]
=
$this
->
showPointValues
;
if
(
!
is_null
(
$this
->
isArea
))
$data
[
'isArea'
]
=
$this
->
isArea
;
$data
=
array_merge
(
$data
,
$this
->
getParentData
());
return
$data
;
}
}
src/Views/Limitless/Piechart/Attachments/PieChartData.php
View file @
87c777df
...
...
@@ -3,7 +3,6 @@ namespace Ceetrox\Sidekick\Views\Limitless\Piechart\Attachments;
use
Ceetrox\Managers\ChartManager\ChartDataManager
;
use
Ceetrox\Managers\ChartManager\ISeriesData
;
use
Ceetrox\Managers\ChartManager\PieSeriesData
;
Class
PieChartData
extends
ChartDataManager
{
...
...
src/
Managers/ChartManager
/PieSeriesData.php
→
src/
Views/Limitless/Piechart/Attachments
/PieSeriesData.php
View file @
87c777df
<?php
namespace
Ceetrox\Managers\ChartManager
;
namespace
Ceetrox\Sidekick\Views\Limitless\Piechart\Attachments
;
use
Ceetrox\Managers\ChartManager\ISeriesData
;
class
PieSeriesData
implements
ISeriesData
{
...
...
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