mirror of
https://github.com/Steffo99/unimore-bda-3.git
synced 2024-11-29 03:14:19 +00:00
33 lines
7.1 KiB
JavaScript
33 lines
7.1 KiB
JavaScript
|
|
Charts.Load().then(function() {
|
|
let tooltip = {"valueDecimals":2,"valuePrefix":"","valueSuffix":"\u20ac"};
|
|
let max = 35;
|
|
|
|
let chartOverview = (function() {
|
|
let setup = (new Charts.Gallery.History.Price())
|
|
.setTitle("Price (EUR)");
|
|
|
|
return (new Charts.Builder(setup, [{"zIndex":4,"name":"Best Price","data":[[1456427084000,18.1289],[1456427432000,18.1289],[1456621072000,18.1289],[1456622141000,19.99],[1457119152000,19.99],[1457739994000,20],[1457739995000,20],[1466127950000,20],[1523893638000,20],[1523897173000,20],[1523907171000,20],[1523907986000,20],[1523923954000,20],[1523924213000,25],[1535697978000,25],[1535698293000,25],[1535863935000,25],[1535948075000,25],[1536030470000,25],[1536031675000,25],[1568930407000,25],[1568932858000,25],[1584738289000,25],[1584744566000,25],[1598270976000,25],[1598274927000,25],[1619957233000,25],[1619985050000,25],[1638885876000,25],[1638888069000,24.99],[1657901478000,24.99],[1657902794000,24.99],[1658851632000,24.99],[1658854564000,24.99],[1660040458000,24.99],[1660041037000,30],[1664893579000,30],[1664894441000,30],[1674768529000,30],[1674770589000,30],[1674806631000,30],[1674807362000,30],[1674824524000,30],[1674825028000,31.99],[1680042302000,31.99],[1680045006000,31.99],[1680063207000,31.99],[1680066402000,31.99],[1686013828000,31.99],[1686014648000,31.99],[1686016864000,31.99]],"step":true,"color":"#90ee7e"},{"zIndex":2,"name":"Best Regular Price","data":[[1456427084000,18.1289],[1456427432000,18.1289],[1456621072000,18.1289],[1456622141000,19.99],[1457119152000,19.99],[1457739994000,20],[1457739995000,20],[1466127950000,20],[1523893638000,20],[1523897173000,20],[1523907171000,20],[1523907986000,20],[1523923954000,20],[1523924213000,25],[1535697978000,25],[1535698293000,25],[1535863935000,25],[1535948075000,25],[1536030470000,25],[1536031675000,25],[1568930407000,25],[1568932858000,25],[1584738289000,25],[1584744566000,25],[1598270976000,25],[1598274927000,25],[1619957233000,25],[1619985050000,25],[1638885876000,25],[1638888069000,24.99],[1657901478000,24.99],[1657902794000,24.99],[1658851632000,24.99],[1658854564000,24.99],[1660040458000,24.99],[1660041037000,30],[1664893579000,30],[1664894441000,30],[1674768529000,30],[1674770589000,30],[1674806631000,30],[1674807362000,30],[1674824524000,30],[1674825028000,31.99],[1680042302000,31.99],[1680045006000,31.99],[1680063207000,31.99],[1680066402000,31.99],[1686013828000,31.99],[1686014648000,31.99],[1686016864000,31.99]],"step":true,"color":"#2b908f"},{"zIndex":1,"name":"Worst Regular Price","data":[[1456427084000,18.1289],[1456427432000,20],[1456621072000,20],[1456622141000,20],[1457119152000,20],[1457739994000,20],[1457739995000,20],[1466127950000,20],[1523893638000,20],[1523897173000,25],[1523907171000,25],[1523907986000,25],[1523923954000,25],[1523924213000,25],[1535697978000,25],[1535698293000,25.89],[1535863935000,25.89],[1535948075000,30],[1536030470000,30],[1536031675000,25.89],[1568930407000,25.89],[1568932858000,26.99],[1584738289000,26.99],[1584744566000,26.49],[1598270976000,26.49],[1598274927000,25.09],[1619957233000,25.09],[1619985050000,26.59],[1638885876000,26.59],[1638888069000,25],[1657901478000,25],[1657902794000,30],[1658851632000,30],[1658854564000,30],[1660040458000,30],[1660041037000,30.09],[1664893579000,30.09],[1664894441000,30],[1674768529000,30],[1674770589000,32],[1674806631000,32],[1674807362000,32],[1674824524000,32],[1674825028000,32],[1680042302000,32],[1680045006000,35],[1680063207000,35],[1680066402000,32],[1686013828000,32],[1686014648000,32],[1686016864000,31.99]],"step":true,"color":"#f04848","visible":false},{"zIndex":3,"type":"area","name":"Historical Low","data":[[1456427084000,18.1289],[1686016981000,18.1289]],"step":true,"color":"#ffb726","lineWidth":1.5,"fillOpacity":0.1}]))
|
|
.setTooltip(tooltip)
|
|
.setDefaultValueRange(0, max)
|
|
.enableLegend()
|
|
.enableRangeSelector();
|
|
})();
|
|
|
|
let chartDetail = (function(){
|
|
let setup = (new Charts.Gallery.History.Price())
|
|
.useThinLine()
|
|
.setTooltipDealFormat()
|
|
.setTitle("Price (EUR)");
|
|
|
|
return (new Charts.Builder(setup, [{"name":"Humble Store","data":[[1456427084000,18.1289],[1456427432000,18.1289],[1456621072000,18.1289],[1456622141000,19.99],[1457119152000,19.99],[1457739994000,null],[1457739995000,20],[1466127950000,20],[1523893638000,20],[1523897173000,20],[1523907171000,20],[1523907986000,25],[1523923954000,25],[1523924213000,25],[1535697978000,25],[1535698293000,25],[1535863935000,25],[1535948075000,25],[1536030470000,25],[1536031675000,25],[1568930407000,25],[1568932858000,25],[1584738289000,25],[1584744566000,25],[1598270976000,25],[1598274927000,25],[1619957233000,25],[1619985050000,25],[1638885876000,25],[1638888069000,25],[1657901478000,25],[1657902794000,25],[1658851632000,25],[1658854564000,30],[1660040458000,30],[1660041037000,30],[1664893579000,30],[1664894441000,30],[1674768529000,30],[1674770589000,30],[1674806631000,30],[1674807362000,32],[1674824524000,32],[1674825028000,32],[1680042302000,32],[1680045006000,32],[1680063207000,32],[1680066402000,32],[1686013828000,32],[1686014648000,32],[1686016864000,null]],"step":true},{"name":"Steam","data":[[1456427432000,20],[1456621072000,20],[1456622141000,20],[1457119152000,20],[1457739994000,20],[1457739995000,20],[1466127950000,20],[1523893638000,20],[1523897173000,25],[1523907171000,25],[1523907986000,25],[1523923954000,25],[1523924213000,25],[1535697978000,25],[1535698293000,25],[1535863935000,25],[1535948075000,25],[1536030470000,25],[1536031675000,25],[1568930407000,25],[1568932858000,25],[1584738289000,25],[1584744566000,25],[1598270976000,25],[1598274927000,25],[1619957233000,25],[1619985050000,25],[1638885876000,25],[1638888069000,25],[1657901478000,25],[1657902794000,30],[1658851632000,30],[1658854564000,30],[1660040458000,30],[1660041037000,30],[1664893579000,30],[1664894441000,30],[1674768529000,30],[1674770589000,32],[1674806631000,32],[1674807362000,32],[1674824524000,32],[1674825028000,32],[1680042302000,32],[1680045006000,35],[1680063207000,35],[1680066402000,32],[1686013828000,32],[1686014648000,null],[1686016864000,null]],"step":true},{"name":"GOG","data":[[1466127950000,20],[1523893638000,20],[1523897173000,20],[1523907171000,20],[1523907986000,20],[1523923954000,20],[1523924213000,25],[1535697978000,25],[1535698293000,25.89],[1535863935000,25.89],[1535948075000,30],[1536030470000,30],[1536031675000,25.89],[1568930407000,25.89],[1568932858000,26.99],[1584738289000,26.99],[1584744566000,26.49],[1598270976000,26.49],[1598274927000,25.09],[1619957233000,25.09],[1619985050000,26.59],[1638885876000,26.59],[1638888069000,24.99],[1657901478000,24.99],[1657902794000,24.99],[1658851632000,24.99],[1658854564000,24.99],[1660040458000,24.99],[1660041037000,30.09],[1664893579000,30.09],[1664894441000,30],[1674768529000,30],[1674770589000,30],[1674806631000,30],[1674807362000,30],[1674824524000,30],[1674825028000,31.99],[1680042302000,31.99],[1680045006000,31.99],[1680063207000,31.99],[1680066402000,31.99],[1686013828000,31.99],[1686014648000,31.99],[1686016864000,31.99]],"step":true}]))
|
|
.setTooltip(tooltip)
|
|
.setDefaultValueRange(0, max)
|
|
.enableRangeSelector();
|
|
})();
|
|
|
|
(new Charts.Tabs("cp", "chart-price"))
|
|
.add("overview", chartOverview)
|
|
.add("detail", chartDetail)
|
|
.load();
|
|
});
|