$(function() { BWA.ChartOptions = BWA.ChartOptions || {}; BWA.ChartOptions.MonthMoney = { getPieChartDayOptions: function() { return _.extend({ //palette: "Pastel", }, BWA.ChartOptions.MonthMoney.getPieChartOptions()); }, getPieChartMonthOptions: function() { return _.extend({ //palette: "Pastel", }, BWA.ChartOptions.MonthMoney.getPieChartOptions()); }, getBarChartDayOptions: function() { return _.extend({ //palette: "Pastel", }, BWA.ChartOptions.MonthMoney.getBarChartOptions($Code.TimeType.DAY)); }, getBarChartMonthOptions: function(handlePointClick) { return _.extend({ //palette: "Pastel", }, BWA.ChartOptions.MonthMoney.getBarChartOptions($Code.TimeType.MONTH, handlePointClick)); }, getPieChartOptions: function() { return { legend: { horizontalAlignment: "right", verticalAlignment: "top", margin: 10, border: { visible: true } }, tooltip: { enabled: true, format: 'fixedPoint', precision: 0, customizeTooltip: function(point) { return { text: [this.argumentText, ': ', this.valueText].join('') }; } }, series: [ { type: "doughnut", // if not, pie. argumentField: "FuelTypeName", argumentType: "string", valueField: "Value", hoverStyle: { color: "#ffd700" }, label: { visible: true, connector: { visible: true }, customizeText: function(pointInfo) { return pointInfo.argumentText; } } } ] }; }, getBarChartOptions: function (codeTimeType, handlePointClick) { var argumentAxis; switch (codeTimeType) { case $Code.TimeType.DAY: argumentAxis = { label: { customizeText: function() { return this.value + '일'; } }, //min: moment().startOf('month').date(), //max: moment().endOf('month').date(), //valueMarginsEnabled: false, tickInterval: 5, //minValueMargin: 0.0, //maxValueMargin: 0.02, }; break; case $Code.TimeType.MONTH: argumentAxis = { label: { customizeText: function() { return this.value + '월'; } }, //min: 1, //max: 12, //valueMarginsEnabled: false, //tickInterval: 1, //minValueMargin: 0.0, //maxValueMargin: 0.02, }; break; } argumentAxis.argumentType = 'string'; return { pointClick: handlePointClick, legend: { visible: false, verticalAlignment: 'center', horizontalAlignment: 'right', border: { visible: true } }, argumentAxis: argumentAxis, commonSeriesSettings: { type: 'stackedBar', argumentField: 'DateTime', selectionStyle: { hatching: { direction: "left" } } }, valueAxis: [{ label: { format: 'currency', //precision: 0 }, title: { text: '원' } }], series: [{ valueField: 'Elec', name: $G('electricity'), label: { visible: false, customizeText: function() { return this.valueText + '원'; } } }, { type: 'stackedBar', valueField: 'Gas', name: $G('gas'), label: { visible: false, customizeText: function() { return this.valueText + '원'; } } }, { type: 'stackedBar', valueField: 'Water', name: $G('water'), label: { visible: false, customizeText: function() { return this.valueText + '원'; } } }], tooltip: { enabled: true, format: 'fixedPoint', precision: 0, //customizeTooltip: function(point) { // return { // text: [this.argumentText, ': ', this.valueText].join('') // }; //} }, }; }, }; });