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
a47b1ab1
Commit
a47b1ab1
authored
Jul 21, 2022
by
Kevin Yumang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SERV-2286 - area options for line chart.
parent
326f3405
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
7 deletions
+18
-7
linechart.init.js
src/Views/Limitless/Linechart/Attachments/linechart.init.js
+12
-4
Chart.blade.php
src/Views/Limitless/Linechart/Chart.blade.php
+1
-0
Config.php
src/Views/Limitless/Linechart/Config.php
+1
-0
Index.blade.php
src/Views/Limitless/Linechart/Documentation/Index.blade.php
+4
-3
No files found.
src/Views/Limitless/Linechart/Attachments/linechart.init.js
View file @
a47b1ab1
...
@@ -63,7 +63,7 @@ function set_data(elementObject, multichart, numberOfCharts, rawData, callback)
...
@@ -63,7 +63,7 @@ function set_data(elementObject, multichart, numberOfCharts, rawData, callback)
setTimeout
(
function
()
{
setTimeout
(
function
()
{
let
options
;
let
options
;
const
defaultColors
=
[
'
#5470c6
'
,
'
#91cc75
'
,
'
#fac858
'
,
'
#ee6666
'
,
'
#73c0de
'
,
'
#3ba272
'
,
'
#fc8452
'
,
'
#9a60b4
'
,
'
#
ea7ccc
'
,
'
#a1887f
'
];
const
defaultColors
=
[
'
#5470c6
'
,
'
#91cc75
'
,
'
#fac858
'
,
'
#ee6666
'
,
'
#73c0de
'
,
'
#3ba272
'
,
'
#fc8452
'
,
'
#9a60b4
'
,
'
#
a1887f
'
,
'
#ffb980
'
,
'
#2ec7c9
'
,
'
#b6a2de
'
,
'
#5ab1ef
'
,
'
#d87a80
'
,
'
#ea7ccc
'
];
if
(
rawData
==
null
)
{
if
(
rawData
==
null
)
{
...
@@ -76,17 +76,18 @@ function set_data(elementObject, multichart, numberOfCharts, rawData, callback)
...
@@ -76,17 +76,18 @@ function set_data(elementObject, multichart, numberOfCharts, rawData, callback)
let
inverted
=
(
elementObject
.
attr
(
'
inverted
'
)
==
'
true
'
||
elementObject
.
attr
(
'
inverted
'
)
==
true
);
// default false
let
inverted
=
(
elementObject
.
attr
(
'
inverted
'
)
==
'
true
'
||
elementObject
.
attr
(
'
inverted
'
)
==
true
);
// default false
let
showDataZoom
=
(
elementObject
.
attr
(
'
data-zoom
'
)
==
'
true
'
||
elementObject
.
attr
(
'
data-zoom
'
)
==
true
);
// default false
let
showDataZoom
=
(
elementObject
.
attr
(
'
data-zoom
'
)
==
'
true
'
||
elementObject
.
attr
(
'
data-zoom
'
)
==
true
);
// default false
let
stacked
=
(
elementObject
.
attr
(
'
stacked
'
)
==
'
true
'
||
elementObject
.
attr
(
'
stacked
'
)
==
true
);
// default false
let
stacked
=
(
elementObject
.
attr
(
'
stacked
'
)
==
'
true
'
||
elementObject
.
attr
(
'
stacked
'
)
==
true
);
// default false
let
isArea
=
(
elementObject
.
attr
(
'
is-area
'
)
==
'
true
'
||
elementObject
.
attr
(
'
is-area
'
)
==
true
);
// default false
let
animationDuration
=
elementObject
.
attr
(
'
animation-duration
'
)
??
750
;
let
animationDuration
=
elementObject
.
attr
(
'
animation-duration
'
)
??
750
;
// ex '{value} users' - https://echarts.apache.org/en/option.html#yAxis.axisLabel.formatter
// ex '{value} users' - https://echarts.apache.org/en/option.html#yAxis.axisLabel.formatter
let
yAxisLabelValueFormat
=
elementObject
.
attr
(
'
y-axis-label-value-format
'
)
??
'
{value}
'
;
let
yAxisLabelValueFormat
=
elementObject
.
attr
(
'
y-axis-label-value-format
'
)
??
null
;
// min | max | average
// min | max | average
let
markLine
=
elementObject
.
attr
(
'
mark-line
'
)
??
null
;
let
markLine
=
elementObject
.
attr
(
'
mark-line
'
)
??
null
;
let
categories
=
JSON
.
parse
(
elementObject
.
attr
(
'
categories
'
))
??
null
;
let
categories
=
JSON
.
parse
(
elementObject
.
attr
(
'
categories
'
))
??
null
;
let
series
=
JSON
.
parse
(
elementObject
.
attr
(
'
series
'
))
??
null
;
let
series
=
JSON
.
parse
(
elementObject
.
attr
(
'
series
'
))
??
null
;
let
seriesNames
=
series
&&
series
.
map
(
function
(
item
){
return
item
.
name
});
let
seriesNames
=
series
&&
series
.
map
(
function
(
item
){
return
item
.
name
});
let
seriesObject
=
setSeries
(
series
,
showPointValues
,
markLine
,
stacked
);
let
seriesObject
=
setSeries
(
series
,
showPointValues
,
markLine
,
stacked
,
isArea
);
console
.
log
(
'
titles
'
,
titles
);
console
.
log
(
'
titles
'
,
titles
);
console
.
log
(
'
colors
'
,
colors
);
console
.
log
(
'
colors
'
,
colors
);
...
@@ -95,6 +96,7 @@ function set_data(elementObject, multichart, numberOfCharts, rawData, callback)
...
@@ -95,6 +96,7 @@ function set_data(elementObject, multichart, numberOfCharts, rawData, callback)
console
.
log
(
'
inverted
'
,
inverted
);
console
.
log
(
'
inverted
'
,
inverted
);
console
.
log
(
'
data-zoom
'
,
showDataZoom
);
console
.
log
(
'
data-zoom
'
,
showDataZoom
);
console
.
log
(
'
stacked
'
,
stacked
);
console
.
log
(
'
stacked
'
,
stacked
);
console
.
log
(
'
is-area
'
,
isArea
);
console
.
log
(
'
animation-duration
'
,
animationDuration
);
console
.
log
(
'
animation-duration
'
,
animationDuration
);
console
.
log
(
'
y-axis-label-value-format
'
,
yAxisLabelValueFormat
);
console
.
log
(
'
y-axis-label-value-format
'
,
yAxisLabelValueFormat
);
console
.
log
(
'
mark-line
'
,
markLine
);
console
.
log
(
'
mark-line
'
,
markLine
);
...
@@ -157,7 +159,7 @@ function set_data(elementObject, multichart, numberOfCharts, rawData, callback)
...
@@ -157,7 +159,7 @@ function set_data(elementObject, multichart, numberOfCharts, rawData, callback)
}
}
// sub functions
// sub functions
function
setSeries
(
seriesData
,
showPointValues
=
false
,
markLineDataType
=
null
,
stack
=
false
)
{
function
setSeries
(
seriesData
,
showPointValues
=
false
,
markLineDataType
=
null
,
stack
=
false
,
isArea
=
false
)
{
// uses series options if available else use global options.
// uses series options if available else use global options.
let
seriesArray
=
[];
let
seriesArray
=
[];
...
@@ -208,6 +210,12 @@ function setSeries(seriesData, showPointValues = false, markLineDataType = null
...
@@ -208,6 +210,12 @@ function setSeries(seriesData, showPointValues = false, markLineDataType = null
}
}
let
area
=
seriesData
[
i
].
isArea
??
isArea
;
if
(
area
==
true
)
{
series
.
areaStyle
=
{};
}
seriesArray
.
push
(
series
);
seriesArray
.
push
(
series
);
}
}
...
...
src/Views/Limitless/Linechart/Chart.blade.php
View file @
a47b1ab1
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
inverted=
"{{ $inverted }}"
inverted=
"{{ $inverted }}"
data-zoom=
"{{ $dataZoom }}"
data-zoom=
"{{ $dataZoom }}"
stacked=
"{{ $stacked }}"
stacked=
"{{ $stacked }}"
is-area=
"{{ $isArea }}"
animation-duration=
"{{ $animationDuration }}"
animation-duration=
"{{ $animationDuration }}"
@
if
($
yAxisLabelValueFormat
!=
null
)
y-axis-label-value-format=
"{{ $yAxisLabelValueFormat }}"
@
endif
@
if
($
yAxisLabelValueFormat
!=
null
)
y-axis-label-value-format=
"{{ $yAxisLabelValueFormat }}"
@
endif
@
if
($
markLine
!=
null
)
mark-line=
"{{ $markLine }}"
@
endif
@
if
($
markLine
!=
null
)
mark-line=
"{{ $markLine }}"
@
endif
...
...
src/Views/Limitless/Linechart/Config.php
View file @
a47b1ab1
...
@@ -64,6 +64,7 @@
...
@@ -64,6 +64,7 @@
->
withInverted
(
$parameters
[
'inverted'
]
??
false
)
->
withInverted
(
$parameters
[
'inverted'
]
??
false
)
->
withDataZoom
(
$parameters
[
'data-zoom'
]
??
false
)
->
withDataZoom
(
$parameters
[
'data-zoom'
]
??
false
)
->
withStacked
(
$parameters
[
'stacked'
]
??
false
)
->
withStacked
(
$parameters
[
'stacked'
]
??
false
)
->
withIsArea
(
$parameters
[
'is-area'
]
??
false
)
->
withAnimationDuration
(
$parameters
[
'animation-duration'
]
??
750
)
->
withAnimationDuration
(
$parameters
[
'animation-duration'
]
??
750
)
->
withYAxisLabelValueFormat
(
$parameters
[
'y-axis-label-value-format'
]
??
null
)
->
withYAxisLabelValueFormat
(
$parameters
[
'y-axis-label-value-format'
]
??
null
)
->
withMarkLine
(
$parameters
[
'mark-line'
]
??
null
)
->
withMarkLine
(
$parameters
[
'mark-line'
]
??
null
)
...
...
src/Views/Limitless/Linechart/Documentation/Index.blade.php
View file @
a47b1ab1
...
@@ -47,13 +47,14 @@
...
@@ -47,13 +47,14 @@
@
Limitless
::
Chart
([
@
Limitless
::
Chart
([
'titles'
=>
'Sample 1'
,
'titles'
=>
'Sample 1'
,
'charts'
=>
1
,
'charts'
=>
1
,
'colors'
=>
[
'#5470c6'
,
'#91cc75'
,
'#fac858'
,
'#ee6666'
,
'#73c0de'
,
'#3ba272'
,
'#fc8452'
,
'#9a60b4'
,
'#
ea7ccc'
,
'#a1887f
'
],
'colors'
=>
[
'#5470c6'
,
'#91cc75'
,
'#fac858'
,
'#ee6666'
,
'#73c0de'
,
'#3ba272'
,
'#fc8452'
,
'#9a60b4'
,
'#
a1887f'
,
'#ffb980'
,
'#2ec7c9'
,
'#b6a2de'
,
'#5ab1ef'
,
'#d87a80'
,
'#ea7ccc
'
],
'point-values'
=>
true
,
'point-values'
=>
true
,
'boundary-gap'
=>
tru
e
,
'boundary-gap'
=>
fals
e
,
'inverted'
=>
false
,
'inverted'
=>
false
,
'data-zoom'
=>
true
,
'data-zoom'
=>
true
,
'stacked'
=>
false
,
'stacked'
=>
false
,
'animation-duration'
=>
1000
,
'is-area'
=>
true
,
'animation-duration'
=>
500
,
'y-axis-label-value-format'
=>
'{value} users'
,
'y-axis-label-value-format'
=>
'{value} users'
,
'mark-line'
=>
'average'
,
'mark-line'
=>
'average'
,
'categories'
=>
$categories
,
'categories'
=>
$categories
,
...
...
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