Need to connect localhost:8086 Influx to an IP address of grafana

Hi , Currently i have an Influxdb installed in raspberry pi, its bind to http://localhost:8086.
my grafana IP looks like : 131.xxx.xxx.xxx , when i upload a datasource i mention in HTTP http://localhost:8086. Its uploaded and show datapoints of influxdb.
But when i login the grafana from any outside PC or laptop , the datapoints of influx are not showing. Network error : undefined.

Can anyone please advise what settings i need to change in grafana datasource and influx config file ?