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
70d8e48c
Commit
70d8e48c
authored
Feb 03, 2021
by
Rodrigo Tapia-McClung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix radar: legend in two columns and year format
parent
ea4af734
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
cuerpos_charts.js
public/js/cuerpos_charts.js
+7
-10
No files found.
public/js/cuerpos_charts.js
View file @
70d8e48c
...
@@ -50,12 +50,13 @@ const makeRadarSeries = (chart, value, category, name, color) => {
...
@@ -50,12 +50,13 @@ const makeRadarSeries = (chart, value, category, name, color) => {
radarSeries
.
dataFields
.
categoryX
=
category
;
radarSeries
.
dataFields
.
categoryX
=
category
;
radarSeries
.
strokeWidth
=
1.5
;
radarSeries
.
strokeWidth
=
1.5
;
radarSeries
.
tooltipText
=
"{valueY}"
;
radarSeries
.
tooltipText
=
"{valueY}"
;
radarSeries
.
name
=
name
;
//FIXME: some months are not showing the appropriate name on tooltip on hover
radarSeries
.
name
=
String
(
name
);
//radarSeries.connect = false;
//radarSeries.connect = false;
//radarSeries.connectEnds = false;
//radarSeries.connectEnds = false;
radarSeries
.
stroke
=
am4core
.
color
(
color
);
// red
radarSeries
.
stroke
=
am4core
.
color
(
color
);
radarSeries
.
tooltip
.
getFillFromObject
=
false
;
radarSeries
.
tooltip
.
getFillFromObject
=
false
;
radarSeries
.
tooltipText
=
"[bold] {name}: [/]{valueY.formatNumber('#,###.0')} Ha[/]"
;
radarSeries
.
tooltipText
=
"[bold] {name
.formatNumber(
\"
####
\"
)
}: [/]{valueY.formatNumber('#,###.0')} Ha[/]"
;
radarSeries
.
tooltip
.
background
.
fill
=
am4core
.
color
(
color
);
radarSeries
.
tooltip
.
background
.
fill
=
am4core
.
color
(
color
);
}
}
...
@@ -83,7 +84,6 @@ const makeLineAxisAndSeries = (chart, field, name, opposite, bullet) => {
...
@@ -83,7 +84,6 @@ const makeLineAxisAndSeries = (chart, field, name, opposite, bullet) => {
lineSeries
.
strokeWidth
=
2
;
lineSeries
.
strokeWidth
=
2
;
lineSeries
.
yAxis
=
lineValueAxis
;
lineSeries
.
yAxis
=
lineValueAxis
;
lineSeries
.
name
=
name
;
lineSeries
.
name
=
name
;
//series.tooltipText = "{name}: [bold]{valueY.formatNumber('#,###.0')} Ha[/]";
lineSeries
.
tooltipText
=
"[bold]{name}: [/]{valueY.formatNumber('#,###.0')} Ha[/]"
;
lineSeries
.
tooltipText
=
"[bold]{name}: [/]{valueY.formatNumber('#,###.0')} Ha[/]"
;
lineSeries
.
tooltipText
.
fontSize
=
10
;
lineSeries
.
tooltipText
.
fontSize
=
10
;
lineSeries
.
tensionX
=
0.8
;
lineSeries
.
tensionX
=
0.8
;
...
@@ -127,7 +127,6 @@ const makeBarSeries = (chart, field, name) => {
...
@@ -127,7 +127,6 @@ const makeBarSeries = (chart, field, name) => {
barSeries
.
dataFields
.
valueY
=
field
;
barSeries
.
dataFields
.
valueY
=
field
;
barSeries
.
dataFields
.
categoryX
=
"grupo"
;
barSeries
.
dataFields
.
categoryX
=
"grupo"
;
barSeries
.
dataFields
.
categoryX
=
"grupo"
;
//"year";
barSeries
.
name
=
name
;
barSeries
.
name
=
name
;
barSeries
.
columns
.
template
.
tooltipText
=
"[underline][bold]Menor a [bold]{categoryX.formatNumber('#,###.#')} Ha[/]: {valueY.formatNumber('#,###.#')} cuerpos[/]"
;
barSeries
.
columns
.
template
.
tooltipText
=
"[underline][bold]Menor a [bold]{categoryX.formatNumber('#,###.#')} Ha[/]: {valueY.formatNumber('#,###.#')} cuerpos[/]"
;
barSeries
.
columns
.
template
.
height
=
am4core
.
percent
(
100
);
barSeries
.
columns
.
template
.
height
=
am4core
.
percent
(
100
);
...
@@ -193,7 +192,7 @@ const makeRadarChart = (data, months, years) => {
...
@@ -193,7 +192,7 @@ const makeRadarChart = (data, months, years) => {
makeRadarRange
(
radarCategoryAxis
,
"enero"
,
"marzo"
,
radarRangeColors
[
0
],
2
);
makeRadarRange
(
radarCategoryAxis
,
"enero"
,
"marzo"
,
radarRangeColors
[
0
],
2
);
makeRadarRange
(
radarCategoryAxis
,
"marzo"
,
"mayo"
,
radarRangeColors
[
1
],
2
);
makeRadarRange
(
radarCategoryAxis
,
"marzo"
,
"mayo"
,
radarRangeColors
[
1
],
2
);
makeRadarRange
(
radarCategoryAxis
,
"mayo"
,
"septiembre"
,
radarRangeColors
[
2
],
4
);
makeRadarRange
(
radarCategoryAxis
,
"mayo"
,
"septiembre"
,
radarRangeColors
[
2
],
4
);
makeRadarRange
(
radarCategoryAxis
,
"septiembre"
,
"diciembre"
,
radarRangeColors
[
3
],
3
);
makeRadarRange
(
radarCategoryAxis
,
"septiembre"
,
"diciembre"
,
radarRangeColors
[
3
],
3
);
makeRadarRange
(
radarCategoryAxis
,
"diciembre"
,
"diciembre"
,
radarRangeColors
[
0
],
1
);
makeRadarRange
(
radarCategoryAxis
,
"diciembre"
,
"diciembre"
,
radarRangeColors
[
0
],
1
);
radarChart
.
cursor
=
new
am4charts
.
RadarCursor
();
//FIXME: cursors are offset
radarChart
.
cursor
=
new
am4charts
.
RadarCursor
();
//FIXME: cursors are offset
...
@@ -201,7 +200,6 @@ const makeRadarChart = (data, months, years) => {
...
@@ -201,7 +200,6 @@ const makeRadarChart = (data, months, years) => {
// add line legend
// add line legend
radarChart
.
legend
=
new
am4charts
.
Legend
();
radarChart
.
legend
=
new
am4charts
.
Legend
();
radarChart
.
legend
.
fontSize
=
10
;
radarChart
.
legend
.
fontSize
=
10
;
//radarChart.legend.fontSize = 9;
radarChart
.
legend
.
labels
.
template
.
fill
=
am4core
.
color
(
mainTextColor
);
radarChart
.
legend
.
labels
.
template
.
fill
=
am4core
.
color
(
mainTextColor
);
radarChart
.
legend
.
itemContainers
.
template
.
paddingTop
=
0
;
radarChart
.
legend
.
itemContainers
.
template
.
paddingTop
=
0
;
radarChart
.
legend
.
itemContainers
.
template
.
paddingBottom
=
0
;
radarChart
.
legend
.
itemContainers
.
template
.
paddingBottom
=
0
;
...
@@ -217,13 +215,12 @@ const makeRadarChart = (data, months, years) => {
...
@@ -217,13 +215,12 @@ const makeRadarChart = (data, months, years) => {
radarChart
.
legend
.
data
=
legenddata
;
radarChart
.
legend
.
data
=
legenddata
;
radarChart
.
legend
.
fontSize
=
10
;
radarChart
.
legend
.
fontSize
=
10
;
radarChart
.
legend
.
labels
.
template
.
fill
=
am4core
.
color
(
mainTextColor
);
radarChart
.
legend
.
labels
.
template
.
fill
=
am4core
.
color
(
mainTextColor
);
radarChart
.
legend
.
maxColumns
=
2
;
let
markerTemplate
=
radarChart
.
legend
.
markers
.
template
;
let
markerTemplate
=
radarChart
.
legend
.
markers
.
template
;
markerTemplate
.
width
=
20
;
markerTemplate
.
width
=
20
;
markerTemplate
.
height
=
20
;
markerTemplate
.
height
=
20
;
radarChart
.
legend
.
itemContainers
.
template
.
paddingTop
=
0
;
radarChart
.
legend
.
itemContainers
.
template
.
paddingTop
=
0
;
//radarChart.legend.itemContainers.template.paddingRight = -10;
//radarChart.legend.itemContainers.template.paddingLeft = -10;
}
}
const
makeLineChart
=
(
data
)
=>
{
const
makeLineChart
=
(
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