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
f339fe45
Commit
f339fe45
authored
Jul 15, 2022
by
Kevin Yumang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SERV-2286 - handle multiple initialisations
parent
c2ab2087
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
9 deletions
+43
-9
linechart.init.js
src/Views/Limitless/Linechart/Attachments/linechart.init.js
+32
-8
Index.blade.php
src/Views/Limitless/Linechart/Documentation/Index.blade.php
+8
-0
Start.blade.php
src/Views/Limitless/Linechart/Start.blade.php
+3
-1
No files found.
src/Views/Limitless/Linechart/Attachments/linechart.init.js
View file @
f339fe45
function
init_line
_chart
()
{
function
set
_chart
()
{
if
(
typeof
echarts
==
'
undefined
'
)
{
console
.
warn
(
'
Warning - echarts.min.js is not loaded.
'
);
return
;
}
setTimeout
(
function
()
{
let
chartCounter
=
0
;
$
(
'
.LimitlessLineChart
'
).
each
(
function
()
{
chartCounter
++
;
let
elementChart
=
$
(
this
);
elementChart
.
attr
(
'
id
'
,
'
LimitlessLineChart
'
+
chartCounter
);
init_line_chart
(
elementChart
[
0
].
id
);
});
},
300
);
}
// main function
function
init_line_chart
(
chartId
)
{
// Define element
let
lineChartElement
=
document
.
getElementById
(
'
line_chart
'
);
let
lineChartElement
=
document
.
getElementById
(
chartId
);
if
(
lineChartElement
)
{
// variables (this will be set by user)
let
titles
=
[
'
A
'
,
'
B
'
,
'
C
'
,
'
D
'
];
let
titles
=
[
'
A
'
];
let
color
=
[
'
#5470c6
'
,
'
#91cc75
'
,
'
#fac858
'
,
'
#ee6666
'
,
'
#73c0de
'
,
'
#3ba272
'
,
'
#fc8452
'
,
'
#9a60b4
'
,
'
#ea7ccc
'
,
'
#a1887f
'
];
let
animationDuration
=
750
;
let
seriesNames
=
[
'
ONC
'
,
'
APR
'
,
'
SPR
'
,
'
PHX
'
,
'
SIG
'
,
'
BRG
'
,
'
MNT
'
,
'
SDK
'
,
'
OCT
'
];
...
...
@@ -103,6 +117,7 @@ function init_line_chart() {
}
}
// sub functions
function
setLineChartSeries
(
name
,
data
=
[],
showPointValues
=
false
,
markLineDataType
=
null
,
stack
=
false
,
index
=
0
)
{
let
series
=
{
...
...
@@ -365,4 +380,13 @@ function setResizeEvent(lineChartElement, lineChart) {
});
}
$
(
document
).
ready
(
init_line_chart
);
\ No newline at end of file
$
(
document
).
ready
(
function
()
{
if
(
typeof
echarts
==
'
undefined
'
)
{
console
.
warn
(
'
Warning - echarts.min.js is not loaded.
'
);
return
;
}
set_chart
();
});
\ No newline at end of file
src/Views/Limitless/Linechart/Documentation/Index.blade.php
View file @
f339fe45
...
...
@@ -7,4 +7,12 @@
@
Limitless
::
LineChartStart
@
Limitless
::
CardStop
@
Limitless
::
CardStart
([
'title'
=>
"Chart 2"
,
'icon'
=>
'icon-info22'
]
)
@
Limitless
::
LineChartStart
@
Limitless
::
CardStop
@
Limitless
::
CardStart
([
'title'
=>
"Chart 3"
,
'icon'
=>
'icon-info22'
]
)
@
Limitless
::
LineChartStart
@
Limitless
::
CardStop
@
stop
src/Views/Limitless/Linechart/Start.blade.php
View file @
f339fe45
<div
class=
"chart-container"
>
<div
class=
"chart has-fixed-height"
id=
"line_chart"
></div>
<div
class=
"chart has-fixed-height LimitlessLineChart"
>
</div>
</div>
\ No newline at end of file
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