Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fordecyt_2019
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rodrigo Tapia-McClung
fordecyt_2019
Commits
a55878b0
Commit
a55878b0
authored
Feb 03, 2021
by
Rodrigo Tapia-McClung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show column cursors for radar, line, and area graphs
parent
17e6b405
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
9 deletions
+31
-9
cuerpos_charts.js
public/js/cuerpos_charts.js
+31
-9
No files found.
public/js/cuerpos_charts.js
View file @
a55878b0
...
@@ -194,11 +194,23 @@ const makeRadarChart = (data, months, years) => {
...
@@ -194,11 +194,23 @@ const makeRadarChart = (data, months, years) => {
makeRadarRange
(
radarCategoryAxis
,
"diciembre"
,
"diciembre"
,
radarRangeColors
[
0
],
1
);
makeRadarRange
(
radarCategoryAxis
,
"diciembre"
,
"diciembre"
,
radarRangeColors
[
0
],
1
);
radarChart
.
cursor
=
new
am4charts
.
RadarCursor
();
radarChart
.
cursor
=
new
am4charts
.
RadarCursor
();
radarCategoryAxis
.
cursorTooltipEnabled
=
false
;
radarChart
.
cursor
.
fullWidthLineX
=
true
;
radarChart
.
cursor
.
lineX
.
strokeWidth
=
1
;
radarChart
.
cursor
.
lineX
.
fill
=
am4core
.
color
(
"#8F3985"
);
radarChart
.
cursor
.
lineX
.
fillOpacity
=
0.1
;
radarChart
.
cursor
.
xAxis
=
radarCategoryAxis
;
//radarCategoryAxis.cursorTooltipEnabled = false;
//FIXME: some months are not showing the appropriate name on tooltip on hover
// in the meantime this is way around to fix cursor columns and not show wrong
// month tooltips
radarChart
.
cursor
.
events
.
on
(
"cursorpositionchanged"
,
function
(
ev
)
{
let
categoryAxis
=
ev
.
target
.
chart
.
xAxes
.
getIndex
(
0
);
console
.
log
(
categoryAxis
.
tooltip
.
opacity
)
categoryAxis
.
tooltip
.
hide
();
});
//radarCategoryAxis.startLocation = -0.0000001;
//radarCategoryAxis.startLocation = -0.0000001;
//radarCategoryAxis.endLocation = 1;
//radarCategoryAxis.endLocation = 1;
//FIXME: some months are not showing the appropriate name on tooltip on hover
// in the meantime, cursor tooltip is disabled
// add line legend
// add line legend
radarChart
.
legend
=
new
am4charts
.
Legend
();
radarChart
.
legend
=
new
am4charts
.
Legend
();
...
@@ -256,6 +268,11 @@ const makeLineChart = (data) => {
...
@@ -256,6 +268,11 @@ const makeLineChart = (data) => {
// Add cursor
// Add cursor
lineChart
.
cursor
=
new
am4charts
.
XYCursor
();
lineChart
.
cursor
=
new
am4charts
.
XYCursor
();
lineChart
.
cursor
.
fullWidthLineX
=
true
;
lineChart
.
cursor
.
lineX
.
strokeWidth
=
1
;
lineChart
.
cursor
.
lineX
.
fill
=
am4core
.
color
(
"#8F3985"
);
lineChart
.
cursor
.
lineX
.
fillOpacity
=
0.1
;
lineChart
.
cursor
.
xAxis
=
lineDateAxis
;
lineChart
.
scrollbarX
=
new
am4core
.
Scrollbar
();
lineChart
.
scrollbarX
=
new
am4core
.
Scrollbar
();
lineChart
.
scrollbarX
.
minHeight
=
1
;
lineChart
.
scrollbarX
.
minHeight
=
1
;
lineChart
.
scrollbarX
.
parent
=
lineChart
.
bottomAxesContainer
;
lineChart
.
scrollbarX
.
parent
=
lineChart
.
bottomAxesContainer
;
...
@@ -278,8 +295,9 @@ const makeAreaChart = (data) => {
...
@@ -278,8 +295,9 @@ const makeAreaChart = (data) => {
areaDateAxis
.
renderer
.
minGridDistance
=
50
;
areaDateAxis
.
renderer
.
minGridDistance
=
50
;
areaDateAxis
.
fontSize
=
10
;
areaDateAxis
.
fontSize
=
10
;
areaDateAxis
.
renderer
.
labels
.
template
.
fill
=
am4core
.
color
(
mainTextColor
);
areaDateAxis
.
renderer
.
labels
.
template
.
fill
=
am4core
.
color
(
mainTextColor
);
areaDateAxis
.
startLocation
=
0.45
;
// change following values to change where series start and end in graph
areaDateAxis
.
endLocation
=
0.55
;
//areaDateAxis.startLocation = 0.45;
//areaDateAxis.endLocation = 0.55;
areaDateAxis
.
baseInterval
=
{
areaDateAxis
.
baseInterval
=
{
timeUnit
:
"month"
,
timeUnit
:
"month"
,
count
:
1
count
:
1
...
@@ -291,9 +309,9 @@ const makeAreaChart = (data) => {
...
@@ -291,9 +309,9 @@ const makeAreaChart = (data) => {
areaValueAxis
.
renderer
.
labels
.
template
.
fill
=
am4core
.
color
(
mainTextColor
);
areaValueAxis
.
renderer
.
labels
.
template
.
fill
=
am4core
.
color
(
mainTextColor
);
// Create series
// Create series
let
areaSeries1
=
makeAreaSeries
(
areaChart
,
"permanente"
,
"Agua permanente"
);
makeAreaSeries
(
areaChart
,
"permanente"
,
"Agua permanente"
);
let
areaSeries2
=
makeAreaSeries
(
areaChart
,
"temporal"
,
"Áreas temporalmente inundadas"
);
makeAreaSeries
(
areaChart
,
"temporal"
,
"Áreas temporalmente inundadas"
);
let
areaSeries3
=
makeAreaSeries
(
areaChart
,
"vegetacion"
,
"Suelos húmedos-vegetación acuática"
);
makeAreaSeries
(
areaChart
,
"vegetacion"
,
"Suelos húmedos-vegetación acuática"
);
// create line ranges
// create line ranges
makeDateRange
(
areaDateAxis
,
0
,
2
,
"#E1DBC8"
);
makeDateRange
(
areaDateAxis
,
0
,
2
,
"#E1DBC8"
);
...
@@ -303,7 +321,11 @@ const makeAreaChart = (data) => {
...
@@ -303,7 +321,11 @@ const makeAreaChart = (data) => {
makeDateRange
(
areaDateAxis
,
11
,
1
,
"#E1DBC8"
);
makeDateRange
(
areaDateAxis
,
11
,
1
,
"#E1DBC8"
);
areaChart
.
cursor
=
new
am4charts
.
XYCursor
();
areaChart
.
cursor
=
new
am4charts
.
XYCursor
();
//areaChart.cursor.xAxis = areaDateAxis;
areaChart
.
cursor
.
fullWidthLineX
=
true
;
areaChart
.
cursor
.
lineX
.
strokeWidth
=
1
;
areaChart
.
cursor
.
lineX
.
fill
=
am4core
.
color
(
"#8F3985"
);
areaChart
.
cursor
.
lineX
.
fillOpacity
=
0.1
;
areaChart
.
cursor
.
xAxis
=
areaDateAxis
;
areaChart
.
scrollbarX
=
new
am4core
.
Scrollbar
();
areaChart
.
scrollbarX
=
new
am4core
.
Scrollbar
();
areaChart
.
scrollbarX
.
minHeight
=
1
;
areaChart
.
scrollbarX
.
minHeight
=
1
;
areaChart
.
scrollbarX
.
parent
=
areaChart
.
bottomAxesContainer
;
areaChart
.
scrollbarX
.
parent
=
areaChart
.
bottomAxesContainer
;
...
...
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