<?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 App engine : how to visualize the proper data type in a timeseries chart in Developer Q&amp;A Forum</title>
    <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/App-engine-how-to-visualize-the-proper-data-type-in-a-timeseries/m-p/288000#M1562</link>
    <description>&lt;P&gt;Hi, I'm following this guide:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.dynatrace.com/develop/visualize-data-in-apps/query-and-visualize-grail-data/" target="_blank" rel="noopener"&gt;Query and visualize Grail data | Dynatrace Developer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But it seems that the&amp;nbsp;&lt;SPAN&gt;TimeseriesChart doesn't show the proper metric type. If for example I run this simple DQL:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;timeseries avg(dt.service.request.response_time)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;then put the result in a timeserieschart with the code below, the metrics appear as a double and not as a duration:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;result&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;data&lt;/SPAN&gt; &lt;SPAN class=""&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;DQLResultConverter&lt;/SPAN&gt; &lt;SPAN class=""&gt;queryResult&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;result&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;data&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt; &lt;SPAN class=""&gt;convertTo&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;timeseries&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;data&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&amp;gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;TimeseriesChart&lt;/SPAN&gt; &lt;SPAN class=""&gt;variant&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;line&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt; &lt;SPAN class=""&gt;data&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;data&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=""&gt;TimeseriesChart&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=""&gt;DQLResultConverter&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Could you please help me to obtain the same resul I have by putting that DQL in a normal dashboard?&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;I've also tryed the alternative approach with a convertToTimeseries function, but still the same result&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;lt;TimeseriesChart.Line&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;pointsDisplay="never" data={convertToTimeseries(&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;result&lt;/SPAN&gt;&lt;/SPAN&gt;.data.records,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;result&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;.data.types)[0]} /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 16 Oct 2025 07:50:15 GMT</pubDate>
    <dc:creator>Tommaso_Fin</dc:creator>
    <dc:date>2025-10-16T07:50:15Z</dc:date>
    <item>
      <title>App engine : how to visualize the proper data type in a timeseries chart</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/App-engine-how-to-visualize-the-proper-data-type-in-a-timeseries/m-p/288000#M1562</link>
      <description>&lt;P&gt;Hi, I'm following this guide:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.dynatrace.com/develop/visualize-data-in-apps/query-and-visualize-grail-data/" target="_blank" rel="noopener"&gt;Query and visualize Grail data | Dynatrace Developer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But it seems that the&amp;nbsp;&lt;SPAN&gt;TimeseriesChart doesn't show the proper metric type. If for example I run this simple DQL:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;timeseries avg(dt.service.request.response_time)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;then put the result in a timeserieschart with the code below, the metrics appear as a double and not as a duration:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;result&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;data&lt;/SPAN&gt; &lt;SPAN class=""&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;DQLResultConverter&lt;/SPAN&gt; &lt;SPAN class=""&gt;queryResult&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;result&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;data&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt; &lt;SPAN class=""&gt;convertTo&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;timeseries&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;data&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&amp;gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;TimeseriesChart&lt;/SPAN&gt; &lt;SPAN class=""&gt;variant&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;line&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt; &lt;SPAN class=""&gt;data&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;data&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=""&gt;TimeseriesChart&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=""&gt;DQLResultConverter&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Could you please help me to obtain the same resul I have by putting that DQL in a normal dashboard?&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;I've also tryed the alternative approach with a convertToTimeseries function, but still the same result&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;lt;TimeseriesChart.Line&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;pointsDisplay="never" data={convertToTimeseries(&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;result&lt;/SPAN&gt;&lt;/SPAN&gt;.data.records,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;result&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;.data.types)[0]} /&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 16 Oct 2025 07:50:15 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/App-engine-how-to-visualize-the-proper-data-type-in-a-timeseries/m-p/288000#M1562</guid>
      <dc:creator>Tommaso_Fin</dc:creator>
      <dc:date>2025-10-16T07:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: App engine : how to visualize the proper data type in a timeseries chart</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/App-engine-how-to-visualize-the-proper-data-type-in-a-timeseries/m-p/288003#M1563</link>
      <description>&lt;P&gt;Hi Tommaso!&lt;BR /&gt;&lt;BR /&gt;The simplest way would be to use our &lt;A href="https://developer.dynatrace.com/design/components-preview/charts/TimeseriesChart/#formatter" target="_blank" rel="noopener"&gt;Formatter&lt;/A&gt; in such a way, let me know if this works for you now:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;import React from "react";
import { useDql } from "@dynatrace-sdk/react-hooks";
import { DQLResultConverter } from "@dynatrace/strato-components-preview/conversion-utilities";
import { TimeseriesChart } from "@dynatrace/strato-components-preview/charts";
import { format, units } from "@dynatrace-sdk/units";

export const Data = () =&amp;gt; {
  const query = "timeseries avg(dt.service.request.response_time)";
  const result = useDql({
    query,
  });

  return (
    &amp;lt;&amp;gt;
      {result.data &amp;amp;&amp;amp; (
        &amp;lt;DQLResultConverter queryResult={result.data} convertTo="timeseries"&amp;gt;
          {(data) =&amp;gt; (
            &amp;lt;TimeseriesChart data={data} variant="line"&amp;gt;
              &amp;lt;TimeseriesChart.YAxis
                formatter={(value) =&amp;gt; format(value, {input: units.time.microsecond, maximumFractionDigits: 0 })}
              /&amp;gt;
            &amp;lt;/TimeseriesChart&amp;gt;
          )}
        &amp;lt;/DQLResultConverter&amp;gt;
      )}
    &amp;lt;/&amp;gt;
  );
};
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 08:53:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/App-engine-how-to-visualize-the-proper-data-type-in-a-timeseries/m-p/288003#M1563</guid>
      <dc:creator>haris</dc:creator>
      <dc:date>2025-10-16T08:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: App engine : how to visualize the proper data type in a timeseries chart</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/App-engine-how-to-visualize-the-proper-data-type-in-a-timeseries/m-p/288005#M1564</link>
      <description>&lt;P&gt;Thanks Haris,&amp;nbsp;&lt;/P&gt;&lt;P&gt;your code works well but what I need something that works also in cases of two timeseries returned by DQL, each of them with different data types. For example a DQL like this:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;timeseries response_time = avg(dt.service.request.response_time) | append [timeseries request_count=count(dt.service.request.count)]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;In this case I need a chart with 2 Y-Axis with different types. I see that this is done automatically if the DQL result has the proper type, just like is happening if I insert this DQL in a normal Dashboard. Could you pease help me to obtain something like this?&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/30575i1D6E14974E06064E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;P&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 16 Oct 2025 08:54:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/App-engine-how-to-visualize-the-proper-data-type-in-a-timeseries/m-p/288005#M1564</guid>
      <dc:creator>Tommaso_Fin</dc:creator>
      <dc:date>2025-10-16T08:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: App engine : how to visualize the proper data type in a timeseries chart</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/App-engine-how-to-visualize-the-proper-data-type-in-a-timeseries/m-p/288015#M1565</link>
      <description>&lt;P&gt;Of course, that is also possible; we just have to individually assign data to different YAxis, and in that case you wouldn't have to use append either, but simply you can use single query to fetch two different metrics, but this should work in both cases, take a look:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;import React from "react";
import { useDql } from "@dynatrace-sdk/react-hooks";
import { TimeseriesChart } from "@dynatrace/strato-components-preview/charts";
import { Flex } from "@dynatrace/strato-components/layouts";
import { ProgressBar } from "@dynatrace/strato-components/content";
import { convertToTimeseries } from "@dynatrace/strato-components-preview/conversion-utilities";
import { format, units } from "@dynatrace-sdk/units";

export const Data = () =&amp;gt; {
  // Option 1: Your suggested append syntax
  const query = `timeseries response_time = avg(dt.service.request.response_time) | append [timeseries request_count=count(dt.service.request.count)]`;

  // Option 2: Alternative multi-metric syntax
  // const query = `timeseries avg(dt.service.request.response_time), count(dt.service.request.count)`;

  const result = useDql({
    query,
  });

  if (result.data === undefined) {
    return &amp;lt;ProgressBar /&amp;gt;;
  }

  const [responseTimeTimeseries, requestCountTimeseries] = convertToTimeseries(
    result.data.records,
    result.data.types
  );

  // Set proper units - this helps with the automatic formatting
  responseTimeTimeseries.unit = "microseconds"; // Keep original unit info

  return (
    &amp;lt;Flex flexDirection="column"&amp;gt;
      &amp;lt;TimeseriesChart style={{ padding: "8px", boxSizing: "border-box" }}&amp;gt;
        &amp;lt;TimeseriesChart.YAxis
          position="left"
          label="Response Time"
          formatter={(value) =&amp;gt;
            format(value, {
              input: units.time.microsecond,
              maximumFractionDigits: 0,
            })
          }
        /&amp;gt;
        &amp;lt;TimeseriesChart.YAxis position="right" label="Request Count" /&amp;gt;
        &amp;lt;TimeseriesChart.Line data={responseTimeTimeseries} /&amp;gt;
        &amp;lt;TimeseriesChart.Line data={requestCountTimeseries} /&amp;gt;
      &amp;lt;/TimeseriesChart&amp;gt;
    &amp;lt;/Flex&amp;gt;
  );
};
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if that's your wanted result &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 09:49:38 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/App-engine-how-to-visualize-the-proper-data-type-in-a-timeseries/m-p/288015#M1565</guid>
      <dc:creator>haris</dc:creator>
      <dc:date>2025-10-16T09:49:38Z</dc:date>
    </item>
  </channel>
</rss>

