Public Dashboard & Charts (without login)

We are a farmer helpline and using Erpnext as our Issue Management System. Farmers call us and we follow up these issues with Local Government Officials and Resolve them.
We are migrating to V13. One of the requirement has been to make aggregated data public in our system so that there is transparency and also the government officials who don’t respond accountable. The core doctype we use is the Issue Doctype in the Support module and also some part of CRM.
Would be helpful if people could suggest if there are ways where we can make some of the dashboards/graphs public, i.e. anyone can view the overall status without being able to login.
Do suggest if anyone has been able to work on this earlier and if there is any documentation available for same.

1 Like

Checkout Metabase.
I am not sure if you can use native ERPNext portal for showing dashboards & charts.

2 Likes

Harsha,

I had struggled a lot to get Frappe chart working for the external web pages. So I gave up and integrated with Google charts.


frappe.ready(async () => {
    // Add the script to the pate
    var script = document.createElement('script');
    script.src = "https://www.gstatic.com/charts/loader.js";
    script.async = true;
    document.getElementsByTagName('head')[0].appendChild(script);

    // Inherit the google
    google.charts.load('current', {packages: ['corechart']});
    google.charts.setOnLoadCallback(fetch_graph);
})

async function fetch_graph() {
    message = (await frappe.call({
        method: 'frappe.desk.doctype.dashboard_chart.dashboard_chart.get',
        args: {
            chart_name : 'Published Help Articles'
        }
    })).message;
    console.log(JSON.stringify(message));
    
    // Set graph options
    var options = {'title':'Published Help Articles',
            //'width':400,
            'height':300};
    
    // Create data table
    var data = new google.visualization.DataTable();
    data.addColumn('string', 'Month');
    data.addColumn('number', 'Count');

    idx = 0;
    var dataset = Array()
    message.labels.forEach(element => {
        var row_data = Array()
        row_data.push(element);
        row_data.push(message.datasets[0].values[idx])
        console.log(row_data);
        dataset.push(row_data);
        idx +=1;
    });
    data.addRows(dataset)

    // Draw the graph
    var chart = new google.visualization.LineChart(document.getElementById('chart'));
    chart.draw(data, options);
    
}
1 Like