<?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: How to change the order of stacked area chart where the small area is on top? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-stacked-area-chart-where-the-small/m-p/261876#M78624</link>
    <description>&lt;P&gt;I think that you are doing this the hard way.  Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source="/xx/*.csv"  Field3="*"  
 | eval latency=if(Field1&amp;lt;500,"Less than 500 ms","500 ms or greater")
 | timechart span=30m count by latency
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your original search goes through the data twice. If the order does not appear the way that you would like, add this to the end&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table _time,"Less than 500 ms","500 ms or greater"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table _time,"500 ms or greater","Less than 500 ms"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 22 Oct 2016 08:15:25 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2016-10-22T08:15:25Z</dc:date>
    <item>
      <title>How to change the order of stacked area chart where the small area is on top?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-stacked-area-chart-where-the-small/m-p/261874#M78622</link>
      <description>&lt;P&gt;I am very new to Splunk&lt;/P&gt;

&lt;P&gt;I need to create a stacked bar/area chart  where I have two separate searches. I'd like to show the small areas on top of the bigger area.  Tried to use &lt;CODE&gt;sort&lt;/CODE&gt; function but it did not work.&lt;/P&gt;

&lt;P&gt;The search function that I use is something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/xx/*.csv"  Field1&amp;lt;500 Field2 Field3="*"  
| timechart span=30m count(Field1) AS Latency_lower_than_500ms 
| appendcols [search source="/xx/*.csv"  Field1&amp;lt;500 Field2 Field3="*"  
| timechart span=30m count(Field1) AS Latency_greater_than_500ms]  
| sort -Field1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This always shows  the bigger area (latency lower than 500ms) on the top but i want it on the 1st stack so that the small one is stacked on top of the bigger one. &lt;/P&gt;

&lt;P&gt;Appreciate any suggestions and help.&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 20:25:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-stacked-area-chart-where-the-small/m-p/261874#M78622</guid>
      <dc:creator>fikristar</dc:creator>
      <dc:date>2016-10-20T20:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the order of stacked area chart where the small area is on top?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-stacked-area-chart-where-the-small/m-p/261875#M78623</link>
      <description>&lt;P&gt;Hi Splunk experts, Is there any suggestion to overcome the issue that i am facing?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 21:59:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-stacked-area-chart-where-the-small/m-p/261875#M78623</guid>
      <dc:creator>fikristar</dc:creator>
      <dc:date>2016-10-21T21:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the order of stacked area chart where the small area is on top?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-stacked-area-chart-where-the-small/m-p/261876#M78624</link>
      <description>&lt;P&gt;I think that you are doing this the hard way.  Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source="/xx/*.csv"  Field3="*"  
 | eval latency=if(Field1&amp;lt;500,"Less than 500 ms","500 ms or greater")
 | timechart span=30m count by latency
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your original search goes through the data twice. If the order does not appear the way that you would like, add this to the end&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table _time,"Less than 500 ms","500 ms or greater"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table _time,"500 ms or greater","Less than 500 ms"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Oct 2016 08:15:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-stacked-area-chart-where-the-small/m-p/261876#M78624</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-10-22T08:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the order of stacked area chart where the small area is on top?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-stacked-area-chart-where-the-small/m-p/261877#M78625</link>
      <description>&lt;P&gt;Hi, Thank you for the suggestion to make a more efficient search.&lt;/P&gt;

&lt;P&gt;My issue is actually I'd like to put the small part , in this case latency more than 500 ms on top of the "less than 500 ms" in a stacked area chart. What I have is the small part is on the bottom o stacked area instead on the top. How do I change the  order of the this stacked area chart? &lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2016 21:13:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-stacked-area-chart-where-the-small/m-p/261877#M78625</guid>
      <dc:creator>fikristar</dc:creator>
      <dc:date>2016-10-22T21:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the order of stacked area chart where the small area is on top?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-stacked-area-chart-where-the-small/m-p/261878#M78626</link>
      <description>&lt;P&gt;That is included in the answer above. Use the table command shown to change the order of the columns. This will also change the order of the stacks. &lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 00:03:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-stacked-area-chart-where-the-small/m-p/261878#M78626</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-10-25T00:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the order of stacked area chart where the small area is on top?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-stacked-area-chart-where-the-small/m-p/261879#M78627</link>
      <description>&lt;P&gt;Thanks, I  managed to get this working by simply changing the order. &lt;/P&gt;

&lt;P&gt;Nevertheless,  | table _time,"500 ms or greater","Less than 500 ms" did not give me the chart I expected. The time chart was not showing correctly when I added this command.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 16:48:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-stacked-area-chart-where-the-small/m-p/261879#M78627</guid>
      <dc:creator>fikristar</dc:creator>
      <dc:date>2016-10-26T16:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the order of stacked area chart where the small area is on top?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-stacked-area-chart-where-the-small/m-p/639311#M221511</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I had this problem and I solved with this workaround.&lt;/P&gt;&lt;P&gt;First, I'm generating the timechart. But the stacked area are randomly ordered.&lt;/P&gt;&lt;P&gt;Then, I transpose column to row, to be able to add a column total, then sort, remove, and then, transpose back to obtain again the timechart, but ordered by amount of each HTTP_Code value.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* 
| timechart count(_raw) by HTTP_Code
| transpose 0 header_field=_time
| addtotals fieldname=total
| sort +total
| fields - total
| transpose 0 header_field=column
| rename column as _time&lt;/LI-CODE&gt;&lt;P&gt;Did someone find an easier solution ?&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Sun, 09 Apr 2023 22:31:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-order-of-stacked-area-chart-where-the-small/m-p/639311#M221511</guid>
      <dc:creator>j01am</dc:creator>
      <dc:date>2023-04-09T22:31:37Z</dc:date>
    </item>
  </channel>
</rss>

