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.
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>