<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can one dynamically set 'managerid' value in a given ChartView? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-one-dynamically-set-managerid-value-in-a-given-ChartView/m-p/473173#M31065</link>
    <description>&lt;P&gt;OK,  I finally resolved the problem partially using one of the suggestions by @gaurav_maniar (thanks again for providing that answer) . The solution for me was to use the following syntax for updating the parameter in charview:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;chart.settings.set("managerid","new_value");
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;instead of using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;chart.set("managerid", "new_value");
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;as suggested in the reply.  &lt;/P&gt;</description>
    <pubDate>Fri, 01 Nov 2019 17:40:06 GMT</pubDate>
    <dc:creator>pgoldweic</dc:creator>
    <dc:date>2019-11-01T17:40:06Z</dc:date>
    <item>
      <title>Can one dynamically set 'managerid' value in a given ChartView?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-one-dynamically-set-managerid-value-in-a-given-ChartView/m-p/473169#M31061</link>
      <description>&lt;P&gt;In an app outside of Splunk that uses the splunkjs stack, I have a default view that displays a few visualizations that use PostProcessSearchManagers within ChartView instances. These panels display reasonably fast, since they're using saved searches.&lt;/P&gt;

&lt;P&gt;However, I'm also being asked to provide an optional time range widget, which, if used to select a particular time range, will 'convert' all the previous panels to use the given time range in the query (instead of the saved searches, which do not take time ranges).&lt;/P&gt;

&lt;P&gt;It occurred to me that I could possibly do this if I dynamically set the 'managerid' value in one of the original ChartView instances to a particular SearchManager (which I'd also define, and would not depend on the saved search). However, is this even possible?&lt;BR /&gt;
If not, how can I achieve this goal? (of (re) charting the results of a 'regular' search instead of those of a 'saved + post process search', in one of my ChartView instances).&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 22:31:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-one-dynamically-set-managerid-value-in-a-given-ChartView/m-p/473169#M31061</guid>
      <dc:creator>pgoldweic</dc:creator>
      <dc:date>2019-10-31T22:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Can one dynamically set 'managerid' value in a given ChartView?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-one-dynamically-set-managerid-value-in-a-given-ChartView/m-p/473170#M31062</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/175056"&gt;@pgoldweic&lt;/a&gt;,&lt;/P&gt;

&lt;P&gt;If you can provide the code sample and exactly than it would be better.&lt;BR /&gt;
Check the below solution for your issues,&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;you can change time range of saved searches&lt;/P&gt;

&lt;P&gt;var savedsearch = new SavedSearchManager({&lt;BR /&gt;
        id: "example-saved-report",&lt;BR /&gt;
        searchname: "Report - Top Pageview",&lt;BR /&gt;
        cache: true,&lt;BR /&gt;
        preview: true,&lt;BR /&gt;
        "dispatch.earliest_time": "-24h@h",&lt;BR /&gt;
        "dispatch.latest_time": "now",&lt;BR /&gt;
        app: "search"&lt;BR /&gt;
    });&lt;BR /&gt;
Now if you want to change the timerange,&lt;/P&gt;

&lt;P&gt;savedsearch.set("dispatch.earliest_time","new_value");&lt;BR /&gt;
savedsearch.set("dispatch.latest","new_value");&lt;BR /&gt;
Now, the same way you can change any parameter in manager, and change managerid in ChartView as well.&lt;/P&gt;

&lt;P&gt;var chart = new ChartView({&lt;BR /&gt;
       id: "example-saved-report",&lt;BR /&gt;
       managerid: "mysearch1",&lt;BR /&gt;
       type: "line",&lt;BR /&gt;
       data: "preview",&lt;BR /&gt;
       el: $("#previewchart")&lt;BR /&gt;
   }).render();&lt;/P&gt;

&lt;P&gt;chart.set("managerid", "new_value");&lt;BR /&gt;
If you are updating any parameter in manager, call the &lt;CODE&gt;startSearch()&lt;/CODE&gt; function.&lt;BR /&gt;
Or if your updating any parameter in chartview, call the &lt;CODE&gt;render()&lt;/CODE&gt; function&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Accept &amp;amp; up-vote the answer if it helps.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-one-dynamically-set-managerid-value-in-a-given-ChartView/m-p/473170#M31062</guid>
      <dc:creator>gaurav_maniar</dc:creator>
      <dc:date>2020-09-30T02:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Can one dynamically set 'managerid' value in a given ChartView?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-one-dynamically-set-managerid-value-in-a-given-ChartView/m-p/473171#M31063</link>
      <description>&lt;P&gt;Thanks for replying!. A couple of comments regarding your suggestions:&lt;BR /&gt;
1- I have already tried calling render() on the charview after making re-setting its 'managerid' but nothing happens on the screen unfortunately, so your second suggestions does not appear to work well (or is incomplete perhaps?)&lt;/P&gt;

&lt;P&gt;2- In terms of updating the time range of the saved search, I'm somewhat confused as to why you'd be able to do this, given that the search represents a report (which, in my understanding, won't even accept a time-range picker when you create it, by nature of being a report -so the time is fixed to whatever you chose at creation time-). So I concluded logically that you should not, in fact, be able to change the time range on a saved search. I could certainly try this out, and perhaps I'd be nicely surprised if it works though :-).&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 14:55:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-one-dynamically-set-managerid-value-in-a-given-ChartView/m-p/473171#M31063</guid>
      <dc:creator>pgoldweic</dc:creator>
      <dc:date>2019-11-01T14:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can one dynamically set 'managerid' value in a given ChartView?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-one-dynamically-set-managerid-value-in-a-given-ChartView/m-p/473172#M31064</link>
      <description>&lt;P&gt;More on (2) above: my desired goal, as stated, is not to change the time range of a saved search (note that this would have undesirable consequences, as stated in the answer to &lt;A href="https://answers.splunk.com/answers/562526/changing-time-range-in-saved-report-utilized-in-da.html"&gt;https://answers.splunk.com/answers/562526/changing-time-range-in-saved-report-utilized-in-da.html&lt;/A&gt;), but also would not work well for my case because my saved searches are &lt;EM&gt;very&lt;/EM&gt; expensive, since they span a large subset of events, so it would be totally impractical to run one of those searches in &lt;EM&gt;real time&lt;/EM&gt;. However, I can create a more targeted real time search that depends on a newly selected time range, so it is in fact to my advantage to use a plain search manager with a real-time search associated with it, and not try to mess up with the expensive saved searches. Hope this makes some sense.&lt;BR /&gt;
So, I still need a way to switch search managers dynamically within a given chart. Would be great if your second suggestion worked well, but as indicated earlier, it did not work for me :-(.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 15:54:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-one-dynamically-set-managerid-value-in-a-given-ChartView/m-p/473172#M31064</guid>
      <dc:creator>pgoldweic</dc:creator>
      <dc:date>2019-11-01T15:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can one dynamically set 'managerid' value in a given ChartView?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-one-dynamically-set-managerid-value-in-a-given-ChartView/m-p/473173#M31065</link>
      <description>&lt;P&gt;OK,  I finally resolved the problem partially using one of the suggestions by @gaurav_maniar (thanks again for providing that answer) . The solution for me was to use the following syntax for updating the parameter in charview:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;chart.settings.set("managerid","new_value");
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;instead of using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;chart.set("managerid", "new_value");
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;as suggested in the reply.  &lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 17:40:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-one-dynamically-set-managerid-value-in-a-given-ChartView/m-p/473173#M31065</guid>
      <dc:creator>pgoldweic</dc:creator>
      <dc:date>2019-11-01T17:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can one dynamically set 'managerid' value in a given ChartView?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-one-dynamically-set-managerid-value-in-a-given-ChartView/m-p/473174#M31066</link>
      <description>&lt;P&gt;OK, come back and click &lt;CODE&gt;Accept&lt;/CODE&gt; on your answer to close the question.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2019 20:35:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-one-dynamically-set-managerid-value-in-a-given-ChartView/m-p/473174#M31066</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-02T20:35:24Z</dc:date>
    </item>
  </channel>
</rss>

