All Apps and Add-ons

Implementing Sankey Chart in Django

theouhuios
Motivator

Hello

How do I add a Sankey chart (or for that matter any webframework toolkit chart) to an exisiting django view. I followed this and was able to create a django dashboard. But now I want to add a panel with sankey chart in the same dashboard. I followed the example in Webtoolkit app and according to the code mentioned on how to use it in other views. This is the code which I am using as of now.

<div class="dashboard-row dashboard-row3 id=example-chart"></div>
<script>
require([
"splunkjs/ready!",
"jquery",
"splunk_wftoolkit/components/sankey/sankey",
],
function(mvc, $, Sankey) {
var sankey = new Sankey({
'id' : 'example',
'managerid' : 'search_chart',
'el' : $('#example-chart')
}).render();
});
</script>

and the searchmanager is

{% searchmanager
        id="search_chart"
        search="index=_internal | head 1000 | stats count by sourcetype clientip"
       cache=True
    %}

But it says No results even though there are results when I run the search. Any help on how to implement this.

0 Karma

magnew_splunk
Splunk Employee
Splunk Employee

Hi theouhuios,

This looks mostly right--I don't see anything obviously wrong with the way you are wiring it up. How do you know the search gets data? If you put a built in chart in the place of the sankey, does that show data?

The only thing I see here that I don't expect to work is that you are missing some quotation marks in your div definition. It should be:

<div class="dashboard-row dashboard-row3" id="example-chart"></div>
0 Karma
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...