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
ef94540a
Commit
ef94540a
authored
Nov 25, 2020
by
Rodrigo Tapia-McClung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor title correction and cleanup
parent
b2533c5a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
16 deletions
+2
-16
evolucion_urbana_charts.js
public/js/evolucion_urbana_charts.js
+2
-16
No files found.
public/js/evolucion_urbana_charts.js
View file @
ef94540a
...
@@ -7,12 +7,6 @@
...
@@ -7,12 +7,6 @@
/* globals am4core, am4charts, am4themes_animated, intervals*/
/* globals am4core, am4charts, am4themes_animated, intervals*/
//let amchart = am4core.registry.baseSprites.find(c => c.htmlContainer.id === "amchartdiv")
//let Chartdata = "http://localhost:8090/data/query/urbanization_year?columns=yeartrimes,area"
//data = d3.json(Chartdata).then(d => amchart.data = d)
//data = d3.json(Chartdata).then(data => console.log(data))
// amchart
// amchart
am4core
.
ready
(
function
()
{
am4core
.
ready
(
function
()
{
...
@@ -23,7 +17,7 @@ am4core.ready(function() {
...
@@ -23,7 +17,7 @@ am4core.ready(function() {
var
chart
=
am4core
.
create
(
"topChart"
,
am4charts
.
XYChart
);
var
chart
=
am4core
.
create
(
"topChart"
,
am4charts
.
XYChart
);
let
ctitle
=
chart
.
titles
.
create
();
let
ctitle
=
chart
.
titles
.
create
();
ctitle
.
text
=
"Área urbanizada
mensual
"
;
ctitle
.
text
=
"Área urbanizada
trimestralmente
"
;
ctitle
.
fontSize
=
15
;
ctitle
.
fontSize
=
15
;
//title.marginBottom = 30;
//title.marginBottom = 30;
ctitle
.
fill
=
am4core
.
color
(
mainTextColor
);
ctitle
.
fill
=
am4core
.
color
(
mainTextColor
);
...
@@ -33,11 +27,9 @@ am4core.ready(function() {
...
@@ -33,11 +27,9 @@ am4core.ready(function() {
let
table
=
"urbanization_year"
;
let
table
=
"urbanization_year"
;
let
query
=
`
${
baseUrl
}
/query/
${
table
}
?columns=yeartrimes,sum(area)/10000 as area,date&group=yeartrimes,date&sort=yeartrimes`
;
let
query
=
`
${
baseUrl
}
/query/
${
table
}
?columns=yeartrimes,sum(area)/10000 as area,date&group=yeartrimes,date&sort=yeartrimes`
;
d3
.
json
(
query
).
then
(
d
=>
chart
.
data
=
d
);
d3
.
json
(
query
).
then
(
d
=>
chart
.
data
=
d
);
//d3.json(query).then(d => pchart.data = d);
// d3.json(query).then(d => console.log(d));
// Create axes
// Create axes
let
xAxis
=
chart
.
xAxes
.
push
(
new
am4charts
.
DateAxis
());
//chart.xAxes.push(new am4charts.DateAxis());
let
xAxis
=
chart
.
xAxes
.
push
(
new
am4charts
.
DateAxis
());
xAxis
.
baseInterval
=
{
timeUnit
:
"month"
,
count
:
3
};
xAxis
.
baseInterval
=
{
timeUnit
:
"month"
,
count
:
3
};
xAxis
.
renderer
.
labels
.
template
.
fill
=
am4core
.
color
(
mainTextColor
);
xAxis
.
renderer
.
labels
.
template
.
fill
=
am4core
.
color
(
mainTextColor
);
xAxis
.
renderer
.
labels
.
template
.
fontSize
=
15
;
xAxis
.
renderer
.
labels
.
template
.
fontSize
=
15
;
...
@@ -212,10 +204,6 @@ am4core.ready(function() {
...
@@ -212,10 +204,6 @@ am4core.ready(function() {
d3
.
json
(
query_r
).
then
(
d
=>
rchart
.
data
=
d
);
d3
.
json
(
query_r
).
then
(
d
=>
rchart
.
data
=
d
);
//chart.padding(20, 20, 20, 20);
//chart.padding(20, 20, 20, 20);
// var chart = am4core.create("chartdiv", am4charts.RadarChart);
//prepareDistanceData(data);
rchart
.
innerRadius
=
am4core
.
percent
(
15
);
rchart
.
innerRadius
=
am4core
.
percent
(
15
);
rchart
.
radius
=
am4core
.
percent
(
90
);
rchart
.
radius
=
am4core
.
percent
(
90
);
//chart.data = weeklyData;
//chart.data = weeklyData;
...
@@ -235,8 +223,6 @@ am4core.ready(function() {
...
@@ -235,8 +223,6 @@ am4core.ready(function() {
dateAxis
.
renderer
.
labels
.
template
.
radius
=
am4core
.
percent
(
-
57
);
dateAxis
.
renderer
.
labels
.
template
.
radius
=
am4core
.
percent
(
-
57
);
dateAxis
.
renderer
.
labels
.
template
.
fontSize
=
12
;
dateAxis
.
renderer
.
labels
.
template
.
fontSize
=
12
;
dateAxis
.
renderer
.
labels
.
template
.
fill
=
am4core
.
color
(
mainTextColor
);
dateAxis
.
renderer
.
labels
.
template
.
fill
=
am4core
.
color
(
mainTextColor
);
// dateAxis.dateFormats.setKey("month", "MMM");
// dateAxis.periodChangeDateFormats.setKey("month", "MMM");
dateAxis
.
cursorTooltipEnabled
=
false
;
dateAxis
.
cursorTooltipEnabled
=
false
;
// dateAxis.calculateTotals = true;
// dateAxis.calculateTotals = true;
...
...
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