Move out functionality
This commit is contained in:
parent
0a9193479a
commit
bcc97e3d72
@ -95,24 +95,9 @@ trait Charts
|
||||
];
|
||||
}
|
||||
|
||||
public function formatMoney( ){
|
||||
|
||||
}
|
||||
|
||||
public function getLineChartOptions()
|
||||
{
|
||||
return [
|
||||
'tooltips' => [
|
||||
'backgroundColor' => '#000000',
|
||||
'titleFontColor' => '#ffffff',
|
||||
'bodyFontColor' => '#e5e5e5',
|
||||
'bodySpacing' => 4,
|
||||
'YrPadding' => 12,
|
||||
'mode' => 'nearest',
|
||||
'intersect' => 0,
|
||||
'position' => 'nearest',
|
||||
'callbacks' => [
|
||||
'label' => new Raw("function(tooltipItem, data) {
|
||||
public function formatMoney($str){
|
||||
return new Raw(
|
||||
"
|
||||
const moneySettings = {
|
||||
decimal: '" . config('money.' . setting('default.currency') . '.decimal_mark') . "',
|
||||
thousands: '". config('money.' . setting('default.currency') . '.thousands_separator') . "',
|
||||
@ -121,7 +106,7 @@ trait Charts
|
||||
precision: '" . config('money.' . setting('default.currency') . '.precision') . "',
|
||||
};
|
||||
|
||||
const formattedCurrency = function (input, opt = moneySettings) {
|
||||
const $str = function (input, opt = moneySettings) {
|
||||
function fixed (precision) {
|
||||
return Math.max(0, Math.min(precision, 20));
|
||||
};
|
||||
@ -157,8 +142,24 @@ trait Charts
|
||||
}
|
||||
|
||||
return negative + joinIntegerAndDecimal(integer, decimal, opt.decimal) + opt.suffix;
|
||||
};
|
||||
}"
|
||||
);
|
||||
}
|
||||
|
||||
public function getLineChartOptions()
|
||||
{
|
||||
return [
|
||||
'tooltips' => [
|
||||
'backgroundColor' => '#000000',
|
||||
'titleFontColor' => '#ffffff',
|
||||
'bodyFontColor' => '#e5e5e5',
|
||||
'bodySpacing' => 4,
|
||||
'YrPadding' => 12,
|
||||
'mode' => 'nearest',
|
||||
'intersect' => 0,
|
||||
'position' => 'nearest',
|
||||
'callbacks' => [
|
||||
'label' => new Raw("function(tooltipItem, data) {
|
||||
return formattedCurrency(tooltipItem.yLabel, moneySettings);
|
||||
}")
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user