Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

Graph Disappears

James Allemang   ( User )

Commented 6 years ago

Here is what I did that got the https to work:


In /config/charts.php there is this bit of code:


'chartjs' => [


            'scripts' => [


                env('APP_URL') . '/public/js/chartjs/Chart.min.js',


            ],


        ],


The bolded part is needs to be replaced with the link from the file /vendor/consoletvs/config/charts.php which is:


https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js


 


For some reason it does work the 'APP_URL' does not put the https:// like it is supposed to for that file and then also some uploaded images. The browser will show images from a non-ssl site on an ssl site, but not use scripts from a non-ssl unless you tell it to.


Hope this helps! I don't know how to fix the issue of why it doesn't work in the first place though because it really seems like it should to me, but I'm not too great with php


 


 

Martin Mrt   ( User )

Commented 6 years ago

Hi James, 


I understand that ccould resolve the issue but it seems that it is a backup alternative.


The app should be able to support https isn’t ? 


Is there another solution more ´logic’ as it should get the charts.min.js from the local former ? 

Denis Dulici   ( Admin )

Commented 6 years ago

This happens only if while installing Akaunting you've not used HTTPS and now you've decided to. All you have to do is to change the APP_URL value in the .env file.

Martin Mrt   ( User )

Commented 6 years ago

Working perfectly thanks !!! 

Jonas   ( User )

Commented 5 years ago

Hello,

I found this post and now finally managed to get back the graphs.
I checked the current version of the config/charts.php and saw that there is no such line as env('APP_URL') . '/public/js/chartjs/Chart.min.js', currently in it. Adding this as mentioned some comments below made my graphs appear again.
Is there a reason for this line not being there or is it an undiscovered bug?

Best,
Jonas

Wong Jun Wang   ( User )

Commented 4 years ago

facing same issue after migrate server, tried to remove

app()->runningInConsole() ? '' :

into

asset('public/js/chartjs/Chart.min.js'),

error show, anyone help?

Wong Jun Wang   ( User )

Commented 4 years ago

app()->runningInConsole() ? '_YOUR_FULL_URL_/public/js/chartjs/Chart.min.js' : asset('public/js/chartjs/Chart.min.js'),

DOES THE WORK

Wu Wuu Jiann   ( User )

Commented 3 years ago

I encountered the same problem using traefik proxy. Managed to find the solution from Akaunting's doc https://akaunting.com/docs/developer-manual/reverse-proxy

Below are the steps I followed to fix the problem

1. Go into the akaunting container:
$ docker exec -it acct_akaunting_1 bash

2. Publish TrustedProxy package
# php artisan vendor:publish --provider="Fideloper\Proxy\TrustedProxyServiceProvider"

3.Edit config/trustedproxy.php file (in my case, the full path is /var/www/akaunting/config/trustedproxy.php). Since 'vi' or 'nano' is not available in the docker container, I used 'sed' command to modify the 'proxy' line.

# cat config/trustedproxy.php | sed "s/# 'proxies' => '\*'/'proxies' => '*'/" > /tmp/trustedproxy.php

4. Ensure that the changes made is correct:
# diff config/trustedproxy.php /tmp
35c35
< # 'proxies' => '*',
---
> 'proxies' => '*',

5. Replace the trustedproxy.php file with the modified one
# mv /tmp/trustedproxy.php config

NOTE: Please ensure that https is used for AKAUNTING_URL in docker-compose.yml file. E.g., - AKAUNTING_URL=https://xxx

Please login or register to leave a response.

Showing 11 to 18 of 18 discussions