{"version":3,"sources":["components/elements/EkoChartBar.js"],"names":["HighchartsReact","require","EkoChartBar","props","state","sales","purchases","title","this","chartRef","getChart","update","text","test","self","Api","get","response","err","arr","arrSales","arrMonth","data","forEach","item","Alıslar","push","parseFloat","Satıslar","month","month_str","setState","dataPurchases","dataSales","dataMonth","config","credits","enabled","chart","type","style","fontFamily","width","height","legend","itemStyle","cursor","verticalAlign","layout","align","y","fontSize","xAxis","categories","yAxis","min","plotOptions","column","shadow","tooltip","series","name","size","innerSize","showInLegend","color","console","log","isPureConfig","ref","React","Component"],"mappings":"4NAGMA,EAAkBC,EAAQ,KAGXC,GAFFD,EAAQ,K,YAGzB,WAAYE,GAAQ,IAAD,8BACjB,4CAAMA,KACDC,MAAQ,CACXC,MAAO,GACPC,UAAW,IAJI,E,yEAOPC,GACEC,KAAKC,SAASC,WACpBC,OAAO,CAAEJ,MAAO,CAAEK,KAAML,O,2CAI9BC,KAAKK,S,6BAIL,IAAMC,EAAON,KAIbO,IAAIC,IAAI,kBAAkB,SAACC,EAAUC,GACnC,IAAIC,EAAM,GACNC,EAAW,GACXC,EAAW,GACfJ,EAASK,KAAKC,SAAQ,SAAAC,GAEpB,IAAIlB,EAAYkB,EAAKC,aACrBN,EAAIO,KAAKC,WAAWrB,IAEpB,IAAID,EAAQmB,EAAKI,cACjBR,EAASM,KAAKC,WAAWtB,IAEzB,IAAIwB,EAAQL,EAAKM,UACjBT,EAASK,KAAKG,MAGhBf,EAAKiB,SAAS,CAAEzB,UAAWa,EAAKd,MAAOe,EAAUS,MAAOR,S,+BAIlD,IAAD,OACHW,EAAgBxB,KAAKJ,MAAME,UAC3B2B,EAAYzB,KAAKJ,MAAMC,MACvB6B,EAAY1B,KAAKJ,MAAMyB,MAGvBM,EAAS,CACXC,QAAS,CACPC,SAAS,GAEXC,MAAO,CACLC,KAAM,SACNC,MAAO,CACLC,WAAY,yBAEdC,MAAO,IACPC,OAAQ,OAEVC,OAAQ,CACNC,UAAW,CACTC,OAAQ,WAEVC,cAAe,SACfC,OAAQ,cAEVzC,MAAO,CACLK,KAAMJ,KAAKL,MAAMI,MACjB0C,MAAO,SACPF,cAAe,SACfG,GAAI,GACJV,MAAO,CAAEW,SAAU,SAErBC,MAAO,CACLC,WAAYnB,GAEdoB,MAAO,CACLC,IAAK,EACLhD,MAAO,CACLK,KAAM,UAGV4C,YAAa,CACXC,OAAQ,CACNC,QAAQ,IAIZC,QAAS,CACPtB,SAAS,GAQXuB,OAAQ,CACN,CACEC,KAAM,oBACNC,KAAM,OACNC,UAAW,MACXC,cAAc,EACd1C,KAAMU,EACNiC,MAAQ,WAGV,CACEJ,KAAM,qBACNC,KAAM,OACNC,UAAW,MACXC,cAAc,EACd1C,KAAMW,EACNgC,MAAO,aAMb,OADAC,QAAQC,IAAIhC,GAEV,kBAACnC,EAAD,CACEmC,OAAQA,EACRiC,cAAY,EACZC,IAAK,SAAAA,GAAG,OAAK,EAAK5D,SAAW4D,S,GA5HIC,IAAMC","file":"static/js/3.b64c0df7.chunk.js","sourcesContent":["import React from \"react\";\nimport Api from \"../../util/Api\";\n\nconst HighchartsReact = require(\"react-highcharts\");\nconst Highcharts = require(\"highcharts\");\n\nexport default class EkoChartBar extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n sales: [],\n purchases: []\n };\n }\n changeTitle(title) {\n let chart = this.chartRef.getChart();\n chart.update({ title: { text: title } });\n }\n\n componentWillMount() {\n this.test();\n }\n\n test() {\n const self = this;\n\n // console.log(\"servise girmedi\")\n\n Api.get(\"/dashboard/bar\", (response, err) => {\n let arr = [];\n let arrSales = [];\n let arrMonth = [];\n response.data.forEach(item => {\n // console.log(\"api girdi\")\n let purchases = item.Alıslar;\n arr.push(parseFloat(purchases));\n\n let sales = item.Satıslar;\n arrSales.push(parseFloat(sales));\n\n let month = item.month_str;\n arrMonth.push(month);\n });\n\n self.setState({ purchases: arr, sales: arrSales, month: arrMonth });\n });\n }\n\n render() {\n let dataPurchases = this.state.purchases;\n let dataSales = this.state.sales;\n let dataMonth = this.state.month;\n\n\n let config = {\n credits: {\n enabled: false\n },\n chart: {\n type: \"column\",\n style: {\n fontFamily: 'Open Sans\",sans-serif'\n },\n width: 850,\n height: 381.5\n },\n legend: {\n itemStyle: {\n cursor: \"default\"\n },\n verticalAlign: \"bottom\",\n layout: \"horizontal\"\n },\n title: {\n text: this.props.title,\n align: \"center\",\n verticalAlign: \"middle\",\n y: -30,\n style: { fontSize: \"11px\" }\n },\n xAxis: {\n categories: dataMonth\n },\n yAxis: {\n min: 0,\n title: {\n text: \"Tutar\"\n }\n },\n plotOptions: {\n column: {\n shadow: false,\n }\n },\n\n tooltip: {\n enabled: true\n // formatter: function () {\n // if (formatter && formatter == 'amount')\n // return '' + this.point.name + ': ' + Util.convertDecimalToMoney(this.y) + ' ₺';\n // else return '' + this.point.name + ': ' + this.y;\n // }\n },\n\n series: [\n {\n name: \"Alışlar\",\n size: \"100%\",\n innerSize: \"95%\",\n showInLegend: true,\n data: dataPurchases,\n color: \"#ca4741\"\n },\n\n {\n name: \"Satışlar\",\n size: \"100%\",\n innerSize: \"95%\",\n showInLegend: true,\n data: dataSales,\n color: \"#4a8bc2\"\n }\n ]\n };\n\n console.log(config);\n return (\n (this.chartRef = ref)}\n />\n );\n }\n}\n"],"sourceRoot":""}