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
9280c168
Commit
9280c168
authored
Jul 25, 2022
by
Kevin Yumang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SERV-2286 - pie chart elements setup and configuration WIP
parent
8c57e2b0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
17 deletions
+19
-17
piechart.init.js
src/Views/Limitless/Piechart/Attachments/piechart.init.js
+4
-9
Config.php
src/Views/Limitless/Piechart/Config.php
+1
-0
Index.blade.php
src/Views/Limitless/Piechart/Documentation/Index.blade.php
+13
-8
PieChart.blade.php
src/Views/Limitless/Piechart/PieChart.blade.php
+1
-0
No files found.
src/Views/Limitless/Piechart/Attachments/piechart.init.js
View file @
9280c168
...
...
@@ -67,18 +67,13 @@ function set_data(elementObject, callback) {
let
title
=
elementObject
.
attr
(
'
title
'
)
??
null
;
let
subtitle
=
elementObject
.
attr
(
'
subtitle
'
)
??
null
;
let
colors
=
JSON
.
parse
(
elementObject
.
attr
(
'
colors
'
))
??
defaultColors
;
let
donut
=
(
elementObject
.
attr
(
'
donut
'
)
==
'
true
'
||
elementObject
.
attr
(
'
donut
'
)
==
true
);
let
animationDuration
=
elementObject
.
attr
(
'
animation-duration
'
)
??
750
;
let
series
=
JSON
.
parse
(
elementObject
.
attr
(
'
series
'
))
??
null
;
console
.
log
(
series
);
let
seriesNames
=
series
&&
series
.
data
.
map
(
function
(
item
){
return
item
.
name
});
let
seriesObject
=
setSeries
(
series
);
let
seriesObject
=
setSeries
(
series
,
donut
);
console
.
log
(
seriesNames
);
console
.
log
(
seriesObject
);
// Options
options
=
{
...
...
@@ -118,7 +113,7 @@ function set_data(elementObject, callback) {
//#endregion
//#region FUNCTIONS FOR OPTIONS
function
setSeries
(
series
)
{
function
setSeries
(
series
,
donut
)
{
if
(
!
series
||
series
.
length
==
0
)
return
[];
...
...
@@ -126,7 +121,7 @@ function setSeries(series) {
name
:
series
.
name
,
type
:
'
pie
'
,
data
:
series
.
data
,
radius
:
'
70%
'
,
radius
:
donut
?
[
'
50%
'
,
'
70%
'
]
:
'
70%
'
,
center
:
[
'
50%
'
,
'
57.5%
'
],
itemStyle
:
{
normal
:
{
...
...
src/Views/Limitless/Piechart/Config.php
View file @
9280c168
...
...
@@ -65,6 +65,7 @@
return
View
(
'Limitless::Piechart.PieChart'
)
->
withTitle
(
$parameters
[
'title'
]
??
null
)
->
withSubtitle
(
$parameters
[
'subtitle'
]
??
null
)
->
withDonut
(
$parameters
[
'donut'
]
??
false
)
->
withColors
(
$parameters
[
'colors'
]
??
null
)
->
withAnimationDuration
(
$parameters
[
'animation-duration'
]
??
750
)
->
withSeries
(
$parameters
[
'series'
]
??
null
)
...
...
src/Views/Limitless/Piechart/Documentation/Index.blade.php
View file @
9280c168
...
...
@@ -18,22 +18,27 @@
@
endphp
<
div
class
="
row
">
<div class="
col
-
xl
-
6
">
@Limitless::CardStart(['title' => "
Basic
Setup
", 'icon' => 'icon-info22' ] )
@Limitless::CardStart(['title' => "
Basic
Pie
Setup
", 'icon' => 'icon-info22' ] )
@Limitless::PieChart([
'title' => 'Basic Pie Chart',
'subtitle' => '
test
basic pie chart setup',
'subtitle' => 'basic pie chart setup',
'series' =>
$data
,
])
@Limitless::CardStop
</div>
<div class="
col
-
xl
-
6
">
@Limitless::CardStart(['title' => "
Basic
Setup
", 'icon' => 'icon-info22' ] )
@Limitless::CardStart(['title' => "
Basic
Donut
Setup
", 'icon' => 'icon-info22' ] )
@Limitless::PieChart([
'title' => 'Basic Donut Chart',
'subtitle' => 'basic donut chart setup',
'donut' => true,
'series' =>
$data
,
])
@Limitless::CardStop
</div>
</div>
@stop
src/Views/Limitless/Piechart/PieChart.blade.php
View file @
9280c168
...
...
@@ -3,6 +3,7 @@
title=
"{{ $title }}"
subtitle=
"{{ $subtitle }}"
colors=
"{{ json_encode($colors) }}"
donut=
"{{$donut}}"
animation-duration=
"{{ $animationDuration }}"
series=
"{{ json_encode($series) }}"
raw=
"{{ json_encode(json_decode($raw)) }}"
...
...
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