I'm trying to render a chart with an "View as Axis" overlay using the javascript splunk-sdk. Setting the following options does not achieve the expected result:
window.splunkjs.UI.ready(window.chartToken, function () {
chart.setData(results, {
...
"axisY2.enabled": true,
"axisY2.scale": "inherit",
"chart.overlayFields": "some-field-name"
});
chart.draw();
});
I also tried setting chart.overlayFields as an array "chart.overlayFields": ["some-field-name"]
What am I missing to make this happen? I have all the options set as shown by looking at a chart definition XML in splunk itself.
Using the Javascript SDK here is how I do this. charting.
seems to be missing
var saved_search_108 = new SavedSearchManager({
id: 'saved_search_108',
searchname: saved_search_lookup[get_object(object_id)]['search_108'][get_corrected_time(earliest_time_id)],
cache: true,
preview: true,
earliest_time: get_corrected_time(earliest_time_id),
latest_time: get_corrected_time(latest_time_id),
app: 'envision',
});
var chart_108 = new ChartView({
id: 'chart_108',
type: 'column',
el: $('#chart_108'),
"charting.axisY2.enabled": true,
"charting.chart.columnAlignment": .5,
"charting.chart.overlayFields": "Total",
"charting.legend.placement": "bottom",
managerid: 'saved_search_108',
}).render();