259 lines
71 KiB
JavaScript
259 lines
71 KiB
JavaScript
|
import * as echarts from 'echarts';
|
||
|
import 'leaflet'
|
||
|
|
||
|
let properties = [[46.49593,9.83718],[46.48089,9.81599],[46.48824,9.83301],[46.497932,9.836767],[46.48615,9.83104],[46.4972399,9.8513866],[46.4867345,9.8349723],[46.4926593,9.8352605],[46.488409,9.840455],[46.5002929,9.8428447],[46.48024,9.81368],[46.48627,9.83095],[46.4904722,9.8346281],[46.48602,9.83109],[46.47736,9.81286],[46.4865553,9.8404283],[46.486563,9.8311711],[46.493988,9.836039],[46.4975,9.83937],[46.4852478,9.8316748],[46.488567,9.8424808],[46.4883782,9.8355532],[46.4868242,9.8332824],[46.49642,9.836712],[46.4883782,9.8355532],[46.47748,9.80948],[46.5002642,9.8429209],[46.4980738,9.8498749],[46.5034907,9.8465318],[46.4868242,9.8332824],[46.47927,9.81362],[46.4875089,9.8328176],[46.4884205,9.837406],[46.4861438,9.8311151],[46.49757,9.83946],[46.4933517,9.8352912],[46.4864667,9.8404068],[46.4866534,9.830708],[46.480585,9.815248],[46.4870555,9.8334099],[46.4786218,9.8127465],[46.48837,9.84037],[46.48604,9.83109],[46.4809238,9.8160696],[46.4898,9.83629],[46.48683,9.8333162],[46.4883782,9.8355532],[46.4771336,9.8134695],[46.4928286,9.8350188],[46.488891,9.841088],[46.499849,9.837025],[46.495869,9.837594],[46.47701,9.81146],[46.486404,9.8416679],[46.4783711,9.8132931],[46.49159,9.83546],[46.488303,9.840426],[46.4975017,9.8395553],[46.48672,9.83717],[46.4883753,9.8403742],[46.4883753,9.8403742],[46.4899857,9.8363568],[46.4863272,9.8405407],[46.497487,9.839477],[46.5020769,9.8418942],[46.50238,9.84558],[46.4884,9.84045],[46.48676,9.835],[46.4782248,9.8130534],[46.47749,9.80944],[46.48824,9.83301],[46.4869233,9.8376718],[46.4883782,9.8355532],[46.4882516,9.8402106],[46.49735,9.83945],[46.4883782,9.8355532],[46.48665,9.83723],[46.4883782,9.8355532],[46.49731,9.838838],[46.4883753,9.8403742],[46.4955609,9.8375856],[46.484052,9.8379806],[46.4883782,9.8355532],[46.496111,9.837175],[46.4843287,9.8376702],[46.4864902,9.8329028],[46.4895127,9.8359552],[46.503276,9.84604],[46.4852328,9.8323521],[46.4873273,9.8371615],[46.503511,9.846615],[46.48668,9.83719],[46.488172,9.833806],[46.4873397,9.831455],[46.4866534,9.830708],[46.495563,9.837539],[46.4984,9.84463],[46.4980738,9.8498749],[46.489777,9.8345806],[46.477581,9.810936],[46.4928286,9.8350188],[46.4974869,9.839558],[46.47591,9.8105111],[46.4887022,9.8352726],[46.4883233,9.8402706],[46.48668,9.83717],[46.47862,9.81366],[46.4891482,9.8343803],[46.4768608,9.813171],[46.477549,9.810314],[46.4895127,9.8359552],[46.498344,9.844374],[46.5032565,9.8460512],[46.4791522,9.8122151],[46.4985892,9.8401749],[46.48664,9.83696],[46.4859316,9.8307934],[46.48665,9.83723],[46.49876,9.837459],[46.4866,9.83716],[46.4885071,9.8411413],[46.4985324,9.8401342],[46.4849695,9.8320309],[46.4978506,9.8383183],[46.503635,9.846695],[46.5023548,9.8455593],[46.4865151,9.8403382],[46.48691,9.83212],[46.498764,9.8374597],[46.5003728,9.8424702],[46.498543,9.840123],[46.4987598,9.8374593],[46.487275,9.8323903],[46.5004613,9.8432744],[46.493155,9.835243],[46.4954953,9.8360637],[46.4890826,9.8354328],[46.4879702,9.8425062],[46.4974869,9.839558],[46.497987,9.8351241],[46.4768315,9.8132372],[46.503511,9.846615],[46.4891952,9.8354489],[46.489485,9.836001],[46.48838,9.83555],[46.4986225,9.8441318],[46.4886203,9.838023],[46.4883753,9.8403742],[46.496488,9.836766],[46.486678,9.837191],[46.476946,9.811528],[46.4786,9.81389],[46.4795257,9.8137264],[46.48089,9.81599],[46.498671,9.837675],[46.4883805,9.8355637],[46.4974869,9.839558],[46.4931507,9.8350282],[46.496111,9.837175],[46.4759,9.80941],[46.4809147,9.8159934],[46.477291,9.811467],[46.4763346,9.8103601],[46.48686,9.84097],[46.4909066,9.8347269],[46.502291,9.845428],[46.480674,9.814221],[46.484197,9.83739],[46.4918196,9.8345876],[46.4915284,9.8338491],[46.4974338,9.8350768],[46.48672,9.83717],[46.4867237,9.8371725],[46.48669,9.83724],[46.4939895,9.8359017],[46.5032761,9.84604],[46.498566,9.840089],[46.498344,9.844374],[46.4786235,9.8136651],[46.50028,9.84108],[46.4893186,9.8335381],[46.4873711,9.8325248],[46.4945882,9.835511],[46.475007,9.807983],[46.47591,9.8105111],[46.4971764,9.8369717],[46.4952387,9.8375284],[46.4940576,9.8369153],[46.4840021,9.8379366],[46.4939
|
||
|
|
||
|
const chartDom = document.getElementById('extractions');
|
||
|
const myChart = echarts.init(chartDom);
|
||
|
|
||
|
|
||
|
const filters = {
|
||
|
regions: ["Davos", "Engadin", "Heidiland", "St. Moritz"]
|
||
|
}
|
||
|
|
||
|
const option = {
|
||
|
tooltip: {
|
||
|
trigger: 'axis'
|
||
|
},
|
||
|
legend: {
|
||
|
data: filters.regions
|
||
|
},
|
||
|
grid: {
|
||
|
left: '0',
|
||
|
right: 10,
|
||
|
bottom: '0',
|
||
|
containLabel: true
|
||
|
},
|
||
|
xAxis: {
|
||
|
type: 'category',
|
||
|
boundaryGap: false,
|
||
|
data: ['2024-04-14','2024-04-15','2024-04-16','2024-04-19','2024-04-22','2024-04-25','2024-04-28','2024-05-01','2024-05-04','2024-05-07','2024-05-10','2024-05-13','2024-05-16','2024-05-19','2024-05-22','2024-05-25','2024-05-28','2024-05-31','2024-06-01','2024-06-04','2024-06-07','2024-06-10','2024-06-13','2024-06-16','2024-06-19','2024-06-22','2024-06-25','2024-06-28','2024-07-01','2024-07-04','2024-07-07','2024-07-10','2024-07-13','2024-07-16','2024-07-19','2024-07-22','2024-07-25','2024-07-28','2024-07-31','2024-08-01','2024-08-04','2024-08-07','2024-08-10','2024-08-13','2024-08-16','2024-08-19','2024-08-22']
|
||
|
},
|
||
|
yAxis: {
|
||
|
type: 'value'
|
||
|
},
|
||
|
series: [
|
||
|
{
|
||
|
name: 'Alle',
|
||
|
type: 'line',
|
||
|
stack: 'Total',
|
||
|
data: [596, 239, 835, 673, 863, 1803, 904, 915, 958, 966, 1001, 1031, 1044, 1055, 1158, 1162, 1181, 1203, 1207, 1214, 1254, 1258, 1264, 1288, 1296, 1305, 1318, 1323, 1330, 1333, 1342, 1350, 1436, 1454, 1461, 1469, 1492, 1504, 1506, 1510, 1512, 1518, 1534, 1535, 1541, 1544, 1500]
|
||
|
},
|
||
|
{
|
||
|
name: 'Heidiland',
|
||
|
type: 'line',
|
||
|
stack: 'Heidiland',
|
||
|
data: [133,64,197,151,197,417,210,213,215,220,226,239,247,251,251,252,262,275,276,277,281,283,284,286,287,287,287,287,287,287,287,289,290,292,293,294,294,294,295,295,295,296,312,313,313,313,301]
|
||
|
},
|
||
|
{
|
||
|
name: 'Davos',
|
||
|
type: 'line',
|
||
|
stack: 'Davos',
|
||
|
data: [133,56,189,152,196,409,206,209,209,209,221,223,223,224,226,227,230,234,236,238,250,252,252,259,261,263,267,270,272,272,274,274,277,278,279,281,286,289,289,289,289,290,290,290,293,296,285]
|
||
|
},
|
||
|
{
|
||
|
name: 'Engadin',
|
||
|
type: 'line',
|
||
|
stack: 'Engadin',
|
||
|
data: [185,73,258,212,278,569,284,289,326,326,340,346,350,355,413,413,413,413,414,415,438,438,442,455,460,463,470,472,477,479,484,486,544,554,558,561,578,585,586,590,592,595,595,595,597,597,583]
|
||
|
},
|
||
|
{
|
||
|
name: 'St. Moritz',
|
||
|
type: 'line',
|
||
|
stack: 'St. Moritz',
|
||
|
data: [145,46,191,158,192,408,204,204,208,211,214,223,224,225,268,270,276,281,281,284,285,285,286,288,288,292,294,294,294,295,297,301,325,330,331,333,334,336,336,336,336,337,337,337,338,338,331]
|
||
|
},
|
||
|
]
|
||
|
};
|
||
|
|
||
|
option && myChart.setOption(option);
|
||
|
|
||
|
const map = L.map('leaflet').setView([46.862962, 9.535296], 9);
|
||
|
|
||
|
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||
|
maxZoom: 19,
|
||
|
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
||
|
}).addTo(map);
|
||
|
|
||
|
properties.forEach( prop => {
|
||
|
L.marker(prop).addTo(map);
|
||
|
})
|
||
|
|
||
|
function getVirtualData(year) {
|
||
|
const date = +echarts.time.parse(year + '-01-01');
|
||
|
const end = +echarts.time.parse(+year + 1 + '-01-01');
|
||
|
const dayTime = 3600 * 24 * 1000;
|
||
|
const data = [];
|
||
|
for (let time = date; time < end; time += dayTime) {
|
||
|
data.push([
|
||
|
echarts.time.format(time, '{yyyy}-{MM}-{dd}', false),
|
||
|
Math.floor(Math.random() * 10000)
|
||
|
]);
|
||
|
}
|
||
|
return data;
|
||
|
}
|
||
|
|
||
|
|
||
|
const sharedData = {
|
||
|
extractionDates: ['2024-04-14','2024-04-15','2024-04-16','2024-04-19','2024-04-22','2024-04-25','2024-04-28','2024-05-01','2024-05-04','2024-05-07','2024-05-10','2024-05-13','2024-05-16','2024-05-19','2024-05-22','2024-05-25','2024-05-28','2024-05-31','2024-06-01','2024-06-04','2024-06-07','2024-06-10','2024-06-13','2024-06-16','2024-06-19','2024-06-22','2024-06-25','2024-06-28','2024-07-01','2024-07-04','2024-07-07','2024-07-10','2024-07-13','2024-07-16','2024-07-19','2024-07-22','2024-07-25','2024-07-28','2024-07-31','2024-08-01','2024-08-04','2024-08-07','2024-08-10','2024-08-13','2024-08-16','2024-08-19','2024-08-22']
|
||
|
}
|
||
|
|
||
|
|
||
|
async function getCalData(ext_date){
|
||
|
|
||
|
return new Promise((res, rej) => {
|
||
|
|
||
|
fetch(`/calendar/${ext_date}.json`)
|
||
|
.then(r => r.json())
|
||
|
.then(json => {
|
||
|
|
||
|
let data = []
|
||
|
|
||
|
for (const [key, val] of Object.entries(json[0])){
|
||
|
data.push([key, val])
|
||
|
}
|
||
|
|
||
|
res(data)
|
||
|
|
||
|
})
|
||
|
})
|
||
|
|
||
|
}
|
||
|
|
||
|
let test = [["2024-09-08",204],["2025-06-05",105],["2024-12-15",175],["2025-09-11",103],["2025-06-30",104],["2024-10-15",201],["2024-09-13",204],["2025-10-15",82],["2024-08-09",143],["2025-01-10",145],["2024-11-13",212],["2025-02-21",88],["2024-11-26",187],["2024-10-22",221],["2024-11-14",214],["2025-02-14",92],["2024-05-27",175],["2024-09-11",206],["2025-04-28",107],["2024-08-03",139],["2025-05-25",105],["2025-10-10",92],["2025-10-26",70],["2025-03-06",109],["2024-12-14",181],["2025-01-05",147],["2024-06-19",167],["2024-06-28",174],["2024-08-10",162],["2025-06-14",107],["2025-10-03",92],["2024-12-22",126],["2025-04-23",107],["2025-05-11",105],["2025-08-23",103],["2024-07-16",149],["2025-08-05",103],["2024-04-25",171],["2025-01-23",148],["2024-10-06",197],["2025-02-16",95],["2024-12-23",116],["2025-03-13",142],["2025-09-01",96],["2024-12-16",179],["2024-08-22",160],["2024-09-28",228],["2024-10-25",220],["2025-08-03",104],["2024-05-25",189],["2024-08-20",158],["2024-08-24",170],["2024-07-12",166],["2024-11-08",220],["2025-03-01",130],["2025-07-13",104],["2024-06-11",181],["2024-08-01",91],["2025-05-29",105],["2025-07-19",107],["2025-10-13",92],["2024-08-07",140],["2024-11-15",216],["2025-04-03",140],["2024-09-20",205],["2025-03-14",144],["2025-06-24",105],["2025-01-19",154],["2024-05-20",171],["2024-08-21",161],["2025-10-23",73],["2024-07-30",108],["2024-11-03",215],["2025-01-04",143],["2025-04-12",111],["2025-08-14",103],["2025-07-05",107],["2025-06-17",105],["2024-06-13",187],["2024-11-12",213],["2025-03-07",110],["2024-04-23",175],["2025-07-06",104],["2025-10-12",92],["2024-12-19",176],["2024-07-18",145],["2024-08-13",145],["2024-07-08",167],["2025-02-11",88],["2024-07-25",150],["2025-02-18",88],["2024-06-27",178],["2024-10-05",212],["2024-05-18",162],["2025-09-05",103],["2025-10-17",72],["2024-07-05",158],["2024-11-20",210],["2024-10-28",215],["2024-05-07",159],["2025-02-27",121],["2025-06-02",105],["2025-04-10",136],["2024-11-25",188],["2024-12-12",174],["2024-11-28",188],["2025-07-12",107],["2025-08-25",95],["2025-10-16",72],["2024-12-25",93],["2024-12-27",94],["2025-09-18",103],["2025-08-16",107],["2024-05-14",169],["2024-06-23",168],["2025-07-08",103],["2025-06-07",107],["2024-05-30",158],["2025-03-26",140],["2025-10-25",75],["2025-05-28",105],["2025-03-08",149],["2024-05-05",158],["2025-04-18",107],["2025-07-22",103],["2024-06-18",165],["2024-11-01",216],["2024-11-02",227],["2025-04-01",142],["2024-04-30",154],["2024-05-26",181],["2025-08-19",102],["2024-09-03",198],["2025-05-08",105],["2025-01-24",144],["2024-08-15",142],["2025-03-27",143],["2024-07-24",147],["2024-12-10",175],["2024-05-19",152],["2024-12-24",96],["2025-03-29",154],["2025-06-23",105],["2025-09-26",95],["2024-09-04",201],["2024-09-09",209],["2024-04-28",159],["2024-05-10",137],["2024-08-18",155],["2024-11-21",212],["2024-09-01",206],["2024-07-22",149],["2025-01-09",146],["2025-01-28",99],["2024-09-02",203],["2025-02-23",121],["2025-05-23",105],["2025-10-29",67],["2024-06-03",180],["2025-04-21",107],["2025-09-17",103],["2025-08-18",103],["2025-05-02",101],["2025-10-04",95],["2024-07-20",168],["2024-11-24",192],["2024-06-10",179],["2025-01-21",146],["2024-09-22",219],["2025-02-15",112],["2024-10-14",201],["2025-05-22",105],["2025-06-21",107],["2025-07-17",103],["2024-12-21",161],["2024-12-29",66],["2024-12-11",172],["2024-07-14",159],["2024-08-17",162],["2024-10-01",197],["2025-01-31",106],["2025-04-26",111],["2024-12-28",88],["2024-08-27",173],["2025-03-16",150],["2025-01-27",103],["2025-06-01",105],["2024-04-14",65],["2024-12-26",99],["2025-04-16",107],["2025-08-02",107],["2025-03-30",147],["2025-08-31",87],["2024-09-29",213],["2025-03-28",143],["2024-12-07",189],["2025-10-28",67],["2024-09-10",207],["2025-03-25",144],["2024-11-10",221],["2025-05-27",105],["2025-08-15",104],["2025-10-24",73],["2024-10-27",222],["2024-04-16",74],["2024-12-02",179],["2025-01-13",159],["2025-05-16",105],["2024-09-21",223],["2025-09-24",99],["2025-07-30",103],["2024-11-07",218],["2025-07-31",103],["2025-03-10",143],["2025-07-29",103],["2025-09-22",103],["2024-08-30"
|
||
|
let test2 = [["2024-09-08",92],["2025-06-05",32],["2024-12-15",80],["2025-09-11",30],["2025-06-30",33],["2024-10-15",92],["2024-09-13",99],["2025-10-15",30],["2024-08-09",71],["2025-01-10",51],["2024-11-13",99],["2025-02-21",43],["2024-11-26",87],["2024-10-22",98],["2024-11-14",100],["2025-02-14",35],["2024-05-27",86],["2024-09-11",96],["2025-04-28",34],["2024-08-03",73],["2025-05-25",34],["2025-10-10",28],["2025-10-26",26],["2025-03-06",47],["2024-12-14",87],["2025-01-05",56],["2024-06-19",84],["2024-06-28",84],["2024-08-10",80],["2025-06-14",32],["2025-10-03",28],["2024-12-22",67],["2025-04-23",34],["2025-05-11",34],["2025-08-23",32],["2024-07-16",71],["2025-08-05",33],["2024-04-25",81],["2025-01-23",47],["2024-10-06",91],["2025-02-16",44],["2024-12-23",66],["2025-03-13",49],["2025-09-01",28],["2024-12-16",83],["2024-08-22",86],["2024-09-28",102],["2024-10-25",98],["2025-08-03",33],["2024-05-25",82],["2024-08-20",83],["2024-08-24",101],["2024-07-12",75],["2024-11-08",98],["2025-03-01",54],["2025-07-13",29],["2024-06-11",73],["2024-08-01",44],["2025-05-29",31],["2025-07-19",31],["2025-10-13",28],["2024-08-07",74],["2024-11-15",100],["2025-04-03",55],["2024-09-20",102],["2025-03-14",50],["2025-06-24",34],["2025-01-19",49],["2024-05-20",76],["2024-08-21",88],["2025-10-23",26],["2024-07-30",63],["2024-11-03",95],["2025-01-04",62],["2025-04-12",32],["2025-08-14",31],["2025-07-05",32],["2025-06-17",32],["2024-06-13",76],["2024-11-12",99],["2025-03-07",47],["2024-04-23",84],["2025-07-06",30],["2025-10-12",28],["2024-12-19",80],["2024-07-18",75],["2024-08-13",80],["2024-07-08",82],["2025-02-11",35],["2024-07-25",79],["2025-02-18",43],["2024-06-27",80],["2024-10-05",99],["2024-05-18",82],["2025-09-05",29],["2025-10-17",26],["2024-07-05",84],["2024-11-20",99],["2024-10-28",102],["2024-05-07",82],["2025-02-27",50],["2025-06-02",32],["2025-04-10",53],["2024-11-25",87],["2024-12-12",81],["2024-11-28",87],["2025-07-12",30],["2025-08-25",30],["2025-10-16",28],["2024-12-25",60],["2024-12-27",52],["2025-09-18",32],["2025-08-16",34],["2024-05-14",79],["2024-06-23",80],["2025-07-08",30],["2025-06-07",32],["2024-05-30",75],["2025-03-26",57],["2025-10-25",26],["2025-05-28",32],["2025-03-08",53],["2024-05-05",87],["2025-04-18",34],["2025-07-22",31],["2024-06-18",83],["2024-11-01",102],["2024-11-02",104],["2025-04-01",56],["2024-04-30",82],["2024-05-26",78],["2025-08-19",32],["2024-09-03",94],["2025-05-08",34],["2025-01-24",47],["2024-08-15",77],["2025-03-27",58],["2024-07-24",80],["2024-12-10",83],["2024-05-19",75],["2024-12-24",63],["2025-03-29",65],["2025-06-23",34],["2025-09-26",30],["2024-09-04",91],["2024-09-09",94],["2024-04-28",83],["2024-05-10",69],["2024-08-18",85],["2024-11-21",100],["2024-09-01",91],["2024-07-22",80],["2025-01-09",52],["2025-01-28",38],["2024-09-02",96],["2025-02-23",51],["2025-05-23",34],["2025-10-29",26],["2024-06-03",73],["2025-04-21",34],["2025-09-17",32],["2025-08-18",32],["2025-05-02",32],["2025-10-04",28],["2024-07-20",90],["2024-11-24",89],["2024-06-10",76],["2025-01-21",47],["2024-09-22",102],["2025-02-15",53],["2024-10-14",91],["2025-05-22",34],["2025-06-21",34],["2025-07-17",29],["2024-12-21",77],["2024-12-29",46],["2024-12-11",82],["2024-07-14",74],["2024-08-17",86],["2024-10-01",91],["2025-01-31",39],["2025-04-26",34],["2024-12-28",52],["2024-08-27",95],["2025-03-16",58],["2025-01-27",37],["2025-06-01",30],["2025-08-02",32],["2024-12-26",56],["2025-04-16",34],["2025-08-31",26],["2025-03-30",57],["2024-09-29",93],["2025-03-28",59],["2024-12-07",87],["2025-10-28",26],["2024-09-10",93],["2025-03-25",57],["2024-11-10",99],["2025-05-27",32],["2025-08-15",31],["2025-10-24",26],["2024-10-27",98],["2024-04-16",47],["2024-12-02",88],["2025-01-13",52],["2025-05-16",34],["2024-09-21",110],["2025-09-24",31],["2025-07-30",31],["2024-11-07",98],["2025-07-31",31],["2025-03-10",49],["2025-07-29",31],["2025-09-22",32],["2024-08-30",97],["2024-10-12",102],["2025-03-05",46],["2025-02-20",43],["2024-05-08",80],["2025-04-19",34],["2024-10-13",92],["2025-06-15",32],["2025-10-20",26],["2024-08-02",45],["2025-10-31",26],["
|
||
|
let test3 = [["2024-09-08",296],["2025-06-05",137],["2024-12-15",255],["2025-09-11",133],["2025-06-30",137],["2024-10-15",293],["2024-09-13",303],["2025-10-15",120],["2024-08-09",214],["2025-01-10",196],["2024-11-13",311],["2025-02-21",131],["2024-11-26",274],["2024-10-22",319],["2024-11-14",314],["2025-02-14",127],["2024-05-27",257],["2024-09-11",302],["2025-04-28",141],["2024-08-03",212],["2025-05-25",139],["2025-10-10",120],["2025-10-26",96],["2025-03-06",156],["2024-12-14",268],["2025-01-05",202],["2024-06-19",251],["2024-06-28",258],["2024-08-10",242],["2025-06-14",139],["2025-10-03",120],["2024-12-22",193],["2025-04-23",141],["2025-05-11",139],["2025-08-23",135],["2024-07-16",219],["2025-08-05",136],["2024-04-25",252],["2025-01-23",195],["2024-10-06",288],["2025-02-16",139],["2024-12-23",182],["2025-03-13",191],["2025-09-01",124],["2024-12-16",262],["2024-08-22",246],["2024-09-28",330],["2024-10-25",318],["2025-08-03",137],["2024-05-25",270],["2024-08-20",241],["2024-08-24",271],["2024-07-12",241],["2024-11-08",318],["2025-03-01",184],["2025-07-13",133],["2024-06-11",254],["2024-08-01",133],["2025-05-29",136],["2025-07-19",138],["2025-10-13",120],["2024-08-07",214],["2024-11-15",316],["2025-04-03",195],["2024-09-20",307],["2025-03-14",194],["2025-06-24",139],["2025-01-19",203],["2024-05-20",247],["2024-08-21",249],["2025-10-23",99],["2024-07-30",169],["2024-11-03",310],["2025-01-04",205],["2025-04-12",143],["2025-08-14",134],["2025-07-05",139],["2025-06-17",137],["2024-06-13",263],["2024-11-12",312],["2025-03-07",157],["2024-04-23",259],["2025-07-06",134],["2025-10-12",120],["2024-12-19",256],["2024-07-18",218],["2024-08-13",225],["2024-07-08",249],["2025-02-11",123],["2024-07-25",228],["2025-02-18",131],["2024-06-27",258],["2024-10-05",311],["2024-05-18",244],["2025-09-05",132],["2025-10-17",107],["2024-07-05",242],["2024-11-20",309],["2024-10-28",317],["2024-05-07",241],["2025-02-27",171],["2025-06-02",137],["2025-04-10",189],["2024-11-25",275],["2024-12-12",255],["2024-11-28",275],["2025-07-12",137],["2025-08-25",125],["2025-10-16",119],["2024-12-25",153],["2024-12-27",146],["2025-09-18",135],["2025-08-16",141],["2024-05-14",248],["2024-06-23",250],["2025-07-08",133],["2025-06-07",139],["2024-05-30",225],["2025-03-26",197],["2025-10-25",101],["2025-05-28",137],["2025-03-08",202],["2024-05-05",245],["2025-04-18",141],["2025-07-22",134],["2024-06-18",244],["2024-11-01",318],["2024-11-02",331],["2025-04-01",198],["2024-04-30",234],["2024-05-26",257],["2025-08-19",134],["2024-09-03",292],["2025-05-08",139],["2025-01-24",191],["2024-08-15",219],["2025-03-27",201],["2024-07-24",227],["2024-12-10",258],["2024-05-19",227],["2024-12-24",159],["2025-03-29",219],["2025-06-23",139],["2025-09-26",125],["2024-09-04",292],["2024-09-09",303],["2024-04-28",242],["2024-05-10",206],["2024-08-18",240],["2024-11-21",312],["2024-09-01",297],["2024-07-22",229],["2025-01-09",196],["2025-01-28",137],["2024-09-02",299],["2025-02-23",172],["2025-05-23",139],["2025-10-29",93],["2024-06-03",251],["2025-04-21",141],["2025-09-17",135],["2025-08-18",135],["2025-05-02",133],["2025-10-04",123],["2024-07-20",258],["2024-11-24",281],["2024-06-10",255],["2025-01-21",193],["2024-09-22",321],["2025-02-15",165],["2024-10-14",292],["2025-05-22",139],["2025-06-21",141],["2025-07-17",132],["2024-12-21",238],["2024-12-29",112],["2024-12-11",254],["2024-07-14",233],["2024-08-17",248],["2024-10-01",288],["2025-01-31",145],["2025-04-26",145],["2024-12-28",140],["2024-08-27",268],["2025-03-16",208],["2025-01-27",140],["2025-06-01",135],["2025-08-02",139],["2024-12-26",155],["2025-04-16",141],["2025-08-31",113],["2025-03-30",204],["2024-09-29",306],["2025-03-28",202],["2024-12-07",276],["2025-10-28",93],["2024-09-10",300],["2025-03-25",201],["2024-11-10",320],["2025-05-27",137],["2025-08-15",135],["2025-10-24",99],["2024-10-27",320],["2024-04-16",119],["2024-12-02",267],["2025-01-13",211],["2025-05-16",139],["2024-09-21",333],["2025-09-24",135],["2025-07-30",134],["2024-11-07",316],["2025-07-31",134],["2025-03-10",192],["2025-07-29",134],["2025-09-22",135],["
|
||
|
|
||
|
const calOptData = new Promise((res, rej) => {
|
||
|
|
||
|
let calOptions = []
|
||
|
let i = 0;
|
||
|
|
||
|
sharedData.extractionDates.forEach(el => {
|
||
|
|
||
|
const daten = getCalData(el).then((result) => {
|
||
|
calOptions.push({
|
||
|
title: {
|
||
|
text: `Auslastung am ${el}`
|
||
|
},
|
||
|
series: [{
|
||
|
type: 'heatmap',
|
||
|
coordinateSystem: 'calendar',
|
||
|
calendarIndex: 0,
|
||
|
data: test
|
||
|
},
|
||
|
{
|
||
|
type: 'heatmap',
|
||
|
coordinateSystem: 'calendar',
|
||
|
calendarIndex: 1,
|
||
|
data: test
|
||
|
}]
|
||
|
})
|
||
|
i++;
|
||
|
});
|
||
|
|
||
|
res(calOptions)
|
||
|
|
||
|
|
||
|
})
|
||
|
|
||
|
|
||
|
|
||
|
})
|
||
|
|
||
|
|
||
|
calOptData.then((data) => {
|
||
|
|
||
|
/*
|
||
|
console.log(data);
|
||
|
console.log(data.length);
|
||
|
console.log(JSON.stringify(data))
|
||
|
*/
|
||
|
|
||
|
const chartCapacity = document.getElementById('capacity');
|
||
|
const cCapacity = echarts.init(chartCapacity);
|
||
|
const cCapacityOptions = {
|
||
|
timeline: {
|
||
|
data: sharedData.extractionDates
|
||
|
},
|
||
|
tooltip: {},
|
||
|
visualMap: {
|
||
|
min: 0,
|
||
|
max: 500,
|
||
|
type: 'piecewise',
|
||
|
orient: 'horizontal',
|
||
|
left: 'center',
|
||
|
top: 0
|
||
|
},
|
||
|
calendar:[
|
||
|
{
|
||
|
orient: 'horizontal',
|
||
|
range: '2024',
|
||
|
top: 50,
|
||
|
right: 0,
|
||
|
left: 50,
|
||
|
bottom: "55%"
|
||
|
},
|
||
|
{
|
||
|
orient: 'horizontal',
|
||
|
range: '2025',
|
||
|
right: 100,
|
||
|
left: 50,
|
||
|
bottom: 60,
|
||
|
top: '55%'
|
||
|
},
|
||
|
],
|
||
|
options: [{
|
||
|
series: [{
|
||
|
type: 'heatmap',
|
||
|
coordinateSystem: 'calendar',
|
||
|
calendarIndex: 0,
|
||
|
data: test
|
||
|
},
|
||
|
{
|
||
|
type: 'heatmap',
|
||
|
coordinateSystem: 'calendar',
|
||
|
calendarIndex: 1,
|
||
|
data: test
|
||
|
}]
|
||
|
},
|
||
|
{
|
||
|
title: {
|
||
|
text: `Auslastung am `
|
||
|
},
|
||
|
series: [{
|
||
|
type: 'heatmap',
|
||
|
coordinateSystem: 'calendar',
|
||
|
calendarIndex: 0,
|
||
|
data: test2
|
||
|
},
|
||
|
{
|
||
|
type: 'heatmap',
|
||
|
coordinateSystem: 'calendar',
|
||
|
calendarIndex: 1,
|
||
|
data: test2
|
||
|
}]
|
||
|
},
|
||
|
{
|
||
|
title: {
|
||
|
text: `Auslastung am `
|
||
|
},
|
||
|
series: [{
|
||
|
type: 'heatmap',
|
||
|
coordinateSystem: 'calendar',
|
||
|
calendarIndex: 0,
|
||
|
data: test3
|
||
|
},
|
||
|
{
|
||
|
type: 'heatmap',
|
||
|
coordinateSystem: 'calendar',
|
||
|
calendarIndex: 1,
|
||
|
data: test3
|
||
|
}]
|
||
|
}]
|
||
|
};
|
||
|
|
||
|
cCapacity.setOption(cCapacityOptions);
|
||
|
|
||
|
})
|