<?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: Create JS function compatible for line chart visual in Dashboarding</title>
    <link>https://community.dynatrace.com/t5/Dashboarding/Create-JavaScript-function-compatible-for-line-chart-visual/m-p/272062#M4842</link>
    <description>&lt;P&gt;Time series charts require a special record format. The record must have the following elements:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;timeframe&lt;/STRONG&gt;: a field of type '&lt;A href="https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/data-types#timeframe" target="_self"&gt;timeframe&lt;/A&gt;' containing timestamps which signify the start time and end time of your timeseries&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;interval&lt;/STRONG&gt;: a value of type '&lt;A href="https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/data-types#duration" target="_self"&gt;duration&lt;/A&gt;' specifying the length of each interval&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; (or any other field name): an sequential array containing all the data points. The size of the array should be consistent with the expected size based on the timeframe and interval elements.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Here is an example of a simple record containing a time series:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marco_irmer_0-1741642402212.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26865i05FE6D7EEC9E5795/image-size/medium?v=v2&amp;amp;px=400" role="button" title="marco_irmer_0-1741642402212.png" alt="marco_irmer_0-1741642402212.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Raw JSON (trimmed down to 5 minutes for readability):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marco_irmer_1-1741642727049.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26867i6F1ED3383E50084B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="marco_irmer_1-1741642727049.png" alt="marco_irmer_1-1741642727049.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You will have to amend your code so that the record format produced by your code matches the format Dynatrace uses for time series data.&lt;/P&gt;</description>
    <pubDate>Mon, 10 Mar 2025 21:39:45 GMT</pubDate>
    <dc:creator>marco_irmer</dc:creator>
    <dc:date>2025-03-10T21:39:45Z</dc:date>
    <item>
      <title>Create JavaScript function compatible for line chart visual</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Create-JavaScript-function-compatible-for-line-chart-visual/m-p/271947#M4836</link>
      <description>&lt;P&gt;Hi Team,&lt;BR /&gt;&lt;BR /&gt;I am using following function to fetch data but using that code I am unable to create line chart.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;export default async function () {&lt;BR /&gt;try {&lt;BR /&gt;const data = JSON.parse($mpcheckoutv2);&lt;BR /&gt;// Check if data is not null and is an array&lt;BR /&gt;if (data &amp;amp;&amp;amp; Array.isArray(data)) {&lt;BR /&gt;// Extract the data from the result&amp;nbsp;&lt;BR /&gt;const Records = data;&lt;BR /&gt;return Records;&lt;BR /&gt;} else {&lt;BR /&gt;throw new Error("Invalid data format");&lt;BR /&gt;}&lt;BR /&gt;} catch (error) {&lt;BR /&gt;// Handle the error&lt;BR /&gt;console.log("Error:", error.message);&lt;BR /&gt;return "Error processing data";&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;I need similar output of following query.&lt;BR /&gt;&lt;BR /&gt;| fieldsAdd success = matchesPhrase(Message, "Order raised successfully" )&lt;BR /&gt;| makeTimeseries count(), by: {success, OrderType}, time: toTimestamp(timestamp)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Dec 2025 11:00:59 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Create-JavaScript-function-compatible-for-line-chart-visual/m-p/271947#M4836</guid>
      <dc:creator>Tarunbt</dc:creator>
      <dc:date>2025-12-05T11:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create JS function compatible for line chart visual</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Create-JavaScript-function-compatible-for-line-chart-visual/m-p/272062#M4842</link>
      <description>&lt;P&gt;Time series charts require a special record format. The record must have the following elements:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;timeframe&lt;/STRONG&gt;: a field of type '&lt;A href="https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/data-types#timeframe" target="_self"&gt;timeframe&lt;/A&gt;' containing timestamps which signify the start time and end time of your timeseries&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;interval&lt;/STRONG&gt;: a value of type '&lt;A href="https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/data-types#duration" target="_self"&gt;duration&lt;/A&gt;' specifying the length of each interval&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; (or any other field name): an sequential array containing all the data points. The size of the array should be consistent with the expected size based on the timeframe and interval elements.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Here is an example of a simple record containing a time series:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marco_irmer_0-1741642402212.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26865i05FE6D7EEC9E5795/image-size/medium?v=v2&amp;amp;px=400" role="button" title="marco_irmer_0-1741642402212.png" alt="marco_irmer_0-1741642402212.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Raw JSON (trimmed down to 5 minutes for readability):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marco_irmer_1-1741642727049.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26867i6F1ED3383E50084B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="marco_irmer_1-1741642727049.png" alt="marco_irmer_1-1741642727049.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You will have to amend your code so that the record format produced by your code matches the format Dynatrace uses for time series data.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 21:39:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Create-JavaScript-function-compatible-for-line-chart-visual/m-p/272062#M4842</guid>
      <dc:creator>marco_irmer</dc:creator>
      <dc:date>2025-03-10T21:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create JS function compatible for line chart visual</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Create-JavaScript-function-compatible-for-line-chart-visual/m-p/272889#M4874</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/19769"&gt;@marco_irmer&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for your response, But my requirment is different. I have two fileds for group by, like this ""&lt;SPAN&gt;&amp;nbsp;{success, OrderType} "" and the output shoud visualize like below image. I want to know what output would be for the below chart using JS code.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-03-18 at 1.57.37 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/27036i4FBC7F979CA2C919/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-03-18 at 1.57.37 PM.png" alt="Screenshot 2025-03-18 at 1.57.37 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 08:19:02 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Create-JavaScript-function-compatible-for-line-chart-visual/m-p/272889#M4874</guid>
      <dc:creator>Tarunbt</dc:creator>
      <dc:date>2025-03-19T08:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Create JS function compatible for line chart visual</title>
      <link>https://community.dynatrace.com/t5/Dashboarding/Create-JavaScript-function-compatible-for-line-chart-visual/m-p/272940#M4875</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/73150"&gt;@Tarunbt&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Your code parses a JSON object and then returns it to Dynatrace as a variable named Records. You'll have to write new JavaScript code that manipulates the JSON into a &lt;A href="https://community.dynatrace.com/t5/Dashboarding/Create-JS-function-compatible-for-line-chart-visual/m-p/272062/highlight/true#M4842" target="_self"&gt;format&lt;/A&gt; that Dynatrace can understand as a timeseries. The exact code necessary to accomplish this depends very much on the specific format of your data. If you are able to share the format of your records your code currently outputs then perhaps it would be possible to give additional pointers.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 23:29:30 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dashboarding/Create-JavaScript-function-compatible-for-line-chart-visual/m-p/272940#M4875</guid>
      <dc:creator>marco_irmer</dc:creator>
      <dc:date>2025-03-19T23:29:30Z</dc:date>
    </item>
  </channel>
</rss>

