Dashboards & Visualizations

How do I render a chart with an overlay using the "View as Axis" option using the splunk-sdk for javascript?

jmacgowan
New Member

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.

0 Karma

sklass
Path Finder

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();
0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...