chess/public/assets/js/pages/features/charts/amcharts/stock-charts.min.js

1 line
9.3 KiB
JavaScript
Raw Normal View History

2024-08-29 03:56:32 +00:00
"use strict";var KTamChartsStockChartsDemo={init:function(){var e,t,a,o,l;t=[],a=[],o=[],l=[],function(){var e=new Date;e.setDate(e.getDate()-500),e.setHours(0,0,0,0);for(var r=0;r<500;r++){var i=new Date(e);i.setDate(i.getDate()+r);var d=Math.round(Math.random()*(40+r))+100+r,n=Math.round(Math.random()*(1e3+r))+500+2*r,s=Math.round(Math.random()*(100+r))+200+r,u=Math.round(Math.random()*(1e3+r))+600+2*r,p=Math.round(Math.random()*(100+r))+200,h=Math.round(Math.random()*(1e3+r))+600+2*r,c=Math.round(Math.random()*(100+r))+200+r,g=Math.round(Math.random()*(100+r))+600+r;t.push({date:i,value:d,volume:n}),a.push({date:i,value:s,volume:u}),o.push({date:i,value:p,volume:h}),l.push({date:i,value:c,volume:g})}}(),AmCharts.makeChart("kt_amcharts_1",{rtl:KTUtil.isRTL(),type:"stock",theme:"light",dataSets:[{title:"first data set",fieldMappings:[{fromField:"value",toField:"value"},{fromField:"volume",toField:"volume"}],dataProvider:t,categoryField:"date"},{title:"second data set",fieldMappings:[{fromField:"value",toField:"value"},{fromField:"volume",toField:"volume"}],dataProvider:a,categoryField:"date"},{title:"third data set",fieldMappings:[{fromField:"value",toField:"value"},{fromField:"volume",toField:"volume"}],dataProvider:o,categoryField:"date"},{title:"fourth data set",fieldMappings:[{fromField:"value",toField:"value"},{fromField:"volume",toField:"volume"}],dataProvider:l,categoryField:"date"}],panels:[{showCategoryAxis:!1,title:"Value",percentHeight:70,stockGraphs:[{id:"g1",valueField:"value",comparable:!0,compareField:"value",balloonText:"[[title]]:<b>[[value]]</b>",compareGraphBalloonText:"[[title]]:<b>[[value]]</b>"}],stockLegend:{periodValueTextComparing:"[[percents.value.close]]%",periodValueTextRegular:"[[value.close]]"}},{title:"Volume",percentHeight:30,stockGraphs:[{valueField:"volume",type:"column",showBalloon:!1,fillAlphas:1}],stockLegend:{periodValueTextRegular:"[[value.close]]"}}],chartScrollbarSettings:{graph:"g1"},chartCursorSettings:{valueBalloonsEnabled:!0,fullWidth:!0,cursorAlpha:.1,valueLineBalloonEnabled:!0,valueLineEnabled:!0,valueLineAlpha:.5},periodSelector:{position:"left",periods:[{period:"MM",selected:!0,count:1,label:"1 month"},{period:"YYYY",count:1,label:"1 year"},{period:"YTD",label:"YTD"},{period:"MAX",label:"MAX"}]},dataSetSelector:{position:"left"},export:{enabled:!0}}),e=[],function(){var t=new Date(2012,0,1);t.setDate(t.getDate()-500),t.setHours(0,0,0,0);for(var a=0;a<500;a++){var o=new Date(t);o.setDate(o.getDate()+a);var l=Math.round(Math.random()*(40+a))+100+a,r=Math.round(1e8*Math.random());e.push({date:o,value:l,volume:r})}}(),AmCharts.makeChart("kt_amcharts_2",{type:"stock",theme:"light",dataSets:[{color:"#b0de09",fieldMappings:[{fromField:"value",toField:"value"},{fromField:"volume",toField:"volume"}],dataProvider:e,categoryField:"date",stockEvents:[{date:new Date(2010,8,19),type:"sign",backgroundColor:"#85CDE6",graph:"g1",text:"S",description:"This is description of an event"},{date:new Date(2010,10,19),type:"flag",backgroundColor:"#FFFFFF",backgroundAlpha:.5,graph:"g1",text:"F",description:"Some longer\ntext can also\n be added"},{date:new Date(2010,11,10),showOnAxis:!0,backgroundColor:"#85CDE6",type:"pin",text:"X",graph:"g1",description:"This is description of an event"},{date:new Date(2010,11,26),showOnAxis:!0,backgroundColor:"#85CDE6",type:"pin",text:"Z",graph:"g1",description:"This is description of an event"},{date:new Date(2011,0,3),type:"sign",backgroundColor:"#85CDE6",graph:"g1",text:"U",description:"This is description of an event"},{date:new Date(2011,1,6),type:"sign",graph:"g1",text:"D",description:"This is description of an event"},{date:new Date(2011,3,5),type:"sign",graph:"g1",text:"L",description:"This is description of an event"},{date:new Date(2011,3,5),type:"sign",graph:"g1",text:"R",description:"This is description of an event"},{date:new Date(2011,5,15),type:"arrowUp",backgroundColor:"#00CC00",graph:"g1",description:"This is description of an event"},{date:new Date(2011,6,25),type:"arrowDown",backgroundColor:"#CC0000",graph:"g1",description:"This is descriptio