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
9ef12c5f
Commit
9ef12c5f
authored
Jul 28, 2022
by
Kevin Yumang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SERV-2286 - added more attributes for line chart data
parent
3886f7e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
190 additions
and
3 deletions
+190
-3
ChartDataManager.php
...ews/Limitless/Linechart/ChartManager/ChartDataManager.php
+190
-3
No files found.
src/Views/Limitless/Linechart/ChartManager/ChartDataManager.php
View file @
9ef12c5f
...
@@ -5,11 +5,39 @@ Class ChartDataManager {
...
@@ -5,11 +5,39 @@ Class ChartDataManager {
private
$categories
;
private
$categories
;
private
$series
;
private
$series
;
private
$numberOfCharts
;
private
$titles
;
private
$colors
;
private
$hasBoundaryGap
;
private
$isInverted
;
private
$hasDataZoom
;
private
$animationDuration
;
private
$yAxisLabelValueFormat
;
private
$rawData
;
// these attributes should also be available on seriesData object.
private
$showPointValues
;
private
$isStacked
;
private
$isArea
;
private
$markLine
;
public
function
__construct
()
public
function
__construct
()
{
{
$this
->
categories
=
[];
$this
->
categories
=
[];
$this
->
series
=
new
Series
();
$this
->
series
=
new
Series
();
$this
->
numberOfCharts
=
1
;
$this
->
colors
=
[];
$this
->
hasBoundaryGap
=
false
;
$this
->
isInverted
=
false
;
$this
->
hasDataZoom
=
false
;
$this
->
animationDuration
=
750
;
$this
->
yAxisLabelValueFormat
=
null
;
$this
->
rawData
=
null
;
$this
->
showPointValues
=
false
;
$this
->
isStacked
=
false
;
$this
->
isArea
=
false
;
$this
->
markLine
=
null
;
}
}
public
static
function
getInstance
()
:
ChartDataManager
public
static
function
getInstance
()
:
ChartDataManager
...
@@ -32,6 +60,153 @@ Class ChartDataManager {
...
@@ -32,6 +60,153 @@ Class ChartDataManager {
return
$this
->
categories
;
return
$this
->
categories
;
}
}
private
function
getNumberOfCharts
()
:
int
{
return
$this
->
series
->
numberOfCharts
();
}
private
function
getTitles
()
{
return
$this
->
titles
;
}
private
function
getColors
()
:
array
{
return
$this
->
colors
;
}
private
function
getHasBoundaryGap
()
:
bool
{
return
$this
->
hasBoundaryGap
;
}
private
function
getIsInverted
()
:
bool
{
return
$this
->
isInverted
;
}
private
function
getHasDataZoom
()
:
bool
{
return
$this
->
hasDataZoom
;
}
private
function
getAnimationDuration
()
:
int
{
return
$this
->
animationDuration
;
}
private
function
getYAxisLabelValueFormat
()
:
?
string
{
return
$this
->
yAxisLabelValueFormat
;
}
private
function
getRawData
()
:
string
{
return
$this
->
rawData
;
}
private
function
getShowPointValues
()
:
bool
{
return
$this
->
showPointValues
;
}
private
function
getIsStacked
()
:
bool
{
return
$this
->
isStacked
;
}
private
function
getIsArea
()
:
bool
{
return
$this
->
isArea
;
}
private
function
getMarkLine
()
:
?
string
{
return
$this
->
markLine
;
}
public
function
setTitle
(
$title
)
:
ChartDataManager
{
if
(
is_array
(
$title
))
{
$this
->
titles
=
array_merge
(
$this
->
titles
,
$title
);
}
else
{
$this
->
titles
[]
=
$title
;
}
return
$this
;
}
public
function
setColors
(
$color
)
:
ChartDataManager
{
if
(
is_array
(
$color
))
{
$this
->
colors
=
array_merge
(
$this
->
colors
,
$color
);
}
else
{
$this
->
colors
[]
=
$color
;
}
return
$this
;
}
public
function
setHasBoundaryGap
(
bool
$value
)
:
ChartDataManager
{
$this
->
hasBoundaryGap
=
$value
;
return
$this
;
}
public
function
setIsInverted
(
bool
$value
)
:
ChartDataManager
{
$this
->
isInverted
=
$value
;
return
$this
;
}
public
function
setHasDataZoom
(
bool
$value
)
:
ChartDataManager
{
$this
->
hasDataZoom
=
$value
;
return
$this
;
}
public
function
setAnimationDuration
(
int
$value
)
:
ChartDataManager
{
$this
->
animationDuration
=
$value
;
return
$this
;
}
public
function
setYAxisLabelValueFormat
(
string
$value
)
:
ChartDataManager
{
$this
->
yAxisLabelValueFormat
=
$value
;
return
$this
;
}
public
function
setRawData
(
string
$value
)
:
ChartDataManager
{
$this
->
rawData
=
$value
;
return
$this
;
}
public
function
setShowPointValues
(
bool
$value
)
:
ChartDataManager
{
$this
->
showPointValues
=
$value
;
return
$this
;
}
public
function
setIsStacked
(
bool
$value
)
:
ChartDataManager
{
$this
->
isStacked
=
$value
;
return
$this
;
}
public
function
setIsArea
(
bool
$value
)
:
ChartDataManager
{
$this
->
isArea
=
$value
;
return
$this
;
}
public
function
setMarkLine
(
string
$value
)
:
ChartDataManager
{
$this
->
markLine
=
$value
;
return
$this
;
}
public
function
addCategories
(
$category
)
:
ChartDataManager
public
function
addCategories
(
$category
)
:
ChartDataManager
{
{
if
(
is_array
(
$category
))
{
if
(
is_array
(
$category
))
{
...
@@ -56,9 +231,21 @@ Class ChartDataManager {
...
@@ -56,9 +231,21 @@ Class ChartDataManager {
public
function
toArray
()
:
array
public
function
toArray
()
:
array
{
{
$data
[
'series'
]
=
$this
->
getSeries
()
->
toArray
();
$data
[
'series'
]
=
$this
->
getSeries
()
->
toArray
();
$data
[
'categories'
]
=
$this
->
getCategories
();
$data
[
'categories'
]
=
$this
->
getCategories
();
$data
[
'charts'
]
=
$this
->
getSeries
()
->
numberOfCharts
();
$data
[
'charts'
]
=
$this
->
getNumberOfCharts
();
$data
[
'titles'
]
=
$this
->
getTitles
();
$data
[
'colors'
]
=
$this
->
getColors
();
$data
[
'boundaryGap'
]
=
$this
->
getHasBoundaryGap
();
$data
[
'inverted'
]
=
$this
->
getIsInverted
();
$data
[
'dataZoom'
]
=
$this
->
getHasDataZoom
();
$data
[
'animationDuration'
]
=
$this
->
getAnimationDuration
();
$data
[
'yAxisLabelValueFormat'
]
=
$this
->
getYAxisLabelValueFormat
();
$data
[
'pointValues'
]
=
$this
->
getShowPointValues
();
$data
[
'stacked'
]
=
$this
->
getIsStacked
();
$data
[
'isArea'
]
=
$this
->
getIsArea
();
$data
[
'markLine'
]
=
$this
->
getMarkLine
();
return
$data
;
return
$data
;
}
}
...
...
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