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!

Data Preparation Made Easy: SPL2 for Edge Processor

By now, you may have heard the exciting news that Edge Processor, the easy-to-use Splunk data preparation tool ...

Introducing Edge Processor: Next Gen Data Transformation

We get it - not only can it take a lot of time, money and resources to get data into Splunk, but it also takes ...

Tips & Tricks When Using Ingest Actions

Tune in to learn about:Large scale architecture when using Ingest ActionsRegEx performance considerations ...