<?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: JS Error | Invalid type passed for ChartSeriesActions after refactoring into a component in Developer Q&amp;A Forum</title>
    <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/JS-Error-Invalid-type-passed-for-ChartSeriesActions-after/m-p/274050#M1363</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/50986"&gt;@andycarlson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Make sense why seems right&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, great to know you found a way. But yeah, sometimes one component works "strangely", I had a similar one with a time picker once. Could you share the solution you found?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Maximiliano Lopes&lt;/P&gt;</description>
    <pubDate>Tue, 01 Apr 2025 10:57:43 GMT</pubDate>
    <dc:creator>MaximilianoML</dc:creator>
    <dc:date>2025-04-01T10:57:43Z</dc:date>
    <item>
      <title>JS Error | Invalid type passed for ChartSeriesActions after refactoring into a component</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/JS-Error-Invalid-type-passed-for-ChartSeriesActions-after/m-p/273166#M1355</link>
      <description>&lt;P&gt;I'm writing an app that has multiple TimeseriesCharts using similar metric dimensions. I want to have the same series actions on each chart without the need to repeat myself in the top level page code.&lt;/P&gt;&lt;P&gt;I've had success on other apps with tabular presentation styles and repetitive cell actions by refactoring the menu into a separate component. When I tried the same approach with a ChartSeriesAction I got a JS error at runtime as soon as the graph becomes non-empty.&lt;/P&gt;&lt;P&gt;The error is&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;JS Error | Invalid type passed for ChartSeriesActions!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if I am doing something wrong or there is a problem in the Dynatrace code but I have run out of other things to try so posting the problem here.&lt;/P&gt;&lt;P&gt;I have created a stripped down version of the &lt;A href="https://developer.dynatrace.com/design/components-preview/charts/TimeseriesChart/#series-actions" target="_self"&gt;series actions&lt;/A&gt; sample code ... stripped down in that onSelect just logs a message to the JS console. This works fine until I refactor it.&lt;/P&gt;&lt;P&gt;The component looks like this...&lt;/P&gt;&lt;PRE&gt;import {&lt;BR /&gt;  ChartSeriesAction,&lt;BR /&gt;} from '@dynatrace/strato-components-preview/charts';&lt;BR /&gt;import { MagnifyingGlassIcon } from '@dynatrace/strato-icons';&lt;BR /&gt;&lt;BR /&gt;export const SampleSeriesAction = ({action}) =&amp;gt; {&lt;BR /&gt;return (&lt;BR /&gt;  &amp;lt;ChartSeriesAction&amp;gt;&lt;BR /&gt;    &amp;lt;ChartSeriesAction.Item&lt;BR /&gt;    key={action.host}&lt;BR /&gt;    onSelect={() =&amp;gt; {&lt;BR /&gt;    console.log('action fired on ',action.host);&lt;BR /&gt;    }}&lt;BR /&gt;    &amp;gt;&lt;BR /&gt;      &amp;lt;ChartSeriesAction.ItemIcon&amp;gt;&lt;BR /&gt;        &amp;lt;MagnifyingGlassIcon /&amp;gt;&lt;BR /&gt;      &amp;lt;/ChartSeriesAction.ItemIcon&amp;gt;&lt;BR /&gt;      Inspect data point&lt;BR /&gt;    &amp;lt;/ChartSeriesAction.Item&amp;gt;&lt;BR /&gt;  &amp;lt;/ChartSeriesAction&amp;gt;&lt;BR /&gt;)&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;And the relevant part of the page code looks like...&lt;/P&gt;&lt;PRE&gt;return (&lt;BR /&gt;  &amp;lt;&amp;gt;&lt;BR /&gt;    &amp;lt;TimeseriesChart&lt;BR /&gt;    data={timeseriesWithCustomData}&lt;BR /&gt;    seriesActions={(seriesAction) =&amp;gt; {&lt;BR /&gt;      const action = seriesAction as ExtendedTimeseries;&lt;BR /&gt;      return (&lt;BR /&gt;        &amp;lt;SampleSeriesAction action={action} /&amp;gt;&lt;BR /&gt;      );&lt;BR /&gt;    }}&lt;BR /&gt;    /&amp;gt;&lt;BR /&gt;  &amp;lt;/&amp;gt;&lt;BR /&gt;);&lt;/PRE&gt;&lt;P&gt;The stack trace from the console says...&lt;/P&gt;&lt;PRE&gt;"stack": "Error: Invalid type passed for ChartSeriesActions!&lt;BR /&gt;at http://localhost:3000/ui/main.js:153525:19&lt;BR /&gt;at ChartLegendItem (http://localhost:3000/ui/main.js:100494:20)&lt;BR /&gt;at renderWithHooks (http://localhost:3000/ui/main.js:13479:28)&lt;BR /&gt;at mountIndeterminateComponent (http://localhost:3000/ui/main.js:16857:23)&lt;BR /&gt;at beginWork (http://localhost:3000/ui/main.js:17845:24)&lt;BR /&gt;at HTMLUnknownElement.callCallback2 (http://localhost:3000/ui/main.js:5585:24)&lt;BR /&gt;at Object.dtAWF [as aWF] (http://localhost:3000/ruxitagentjs_ICA7NVfqrux_10307250124095659.js:252:348)&lt;BR /&gt;at Object.dispatchWrapper (http://localhost:3000/ruxitagentjs_ICA7NVfqrux_10307250124095659.js:411:168)&lt;BR /&gt;at HTMLUnknownElement.dispatchEvent (http://localhost:3000/ruxitagentjs_ICA7NVfqrux_10307250124095659.js:398:100)&lt;BR /&gt;at Object.invokeGuardedCallbackDev (http://localhost:3000/ui/main.js:5610:26)"&lt;/PRE&gt;&lt;P&gt;I have also attached the two source files, suffixed by '.txt'&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2025 11:01:30 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/JS-Error-Invalid-type-passed-for-ChartSeriesActions-after/m-p/273166#M1355</guid>
      <dc:creator>andycarlson</dc:creator>
      <dc:date>2025-03-21T11:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: JS Error | Invalid type passed for ChartSeriesActions after refactoring into a component</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/JS-Error-Invalid-type-passed-for-ChartSeriesActions-after/m-p/274046#M1361</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/50986"&gt;@andycarlson&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;I can try to help you with that, I read the code you attached and seems right, I just have some concerns about that ExtendedTimeseries it's correctly extends the Timeseries type and includes all necessary properties. Could you check that, please?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Maximiliano Lopes&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 10:34:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/JS-Error-Invalid-type-passed-for-ChartSeriesActions-after/m-p/274046#M1361</guid>
      <dc:creator>MaximilianoML</dc:creator>
      <dc:date>2025-04-01T10:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: JS Error | Invalid type passed for ChartSeriesActions after refactoring into a component</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/JS-Error-Invalid-type-passed-for-ChartSeriesActions-after/m-p/274049#M1362</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN&gt;Maximiliano.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The ExtendedTimeseries code is straight from the sample on the Dynatrace site. I haven't changed that part, just deleted some stuff in other places that was not relevant to the problem. I copied this sample to check that the issue wasn't with something in my code... which I don't think it is.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My 'real' code uses Timeseries data from a DQL query so there is no ExtendedTimeseries in my code... but I hit the same issue there.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FWIW I found a workaround... If I refactor the entire chart as a component I don't hit this issue so it is now not a blocker for me... but I still think that people should have the option to refactor just the series actions - doing that works fine for table actions, but not chart series actions.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 10:52:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/JS-Error-Invalid-type-passed-for-ChartSeriesActions-after/m-p/274049#M1362</guid>
      <dc:creator>andycarlson</dc:creator>
      <dc:date>2025-04-01T10:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: JS Error | Invalid type passed for ChartSeriesActions after refactoring into a component</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/JS-Error-Invalid-type-passed-for-ChartSeriesActions-after/m-p/274050#M1363</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/50986"&gt;@andycarlson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Make sense why seems right&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, great to know you found a way. But yeah, sometimes one component works "strangely", I had a similar one with a time picker once. Could you share the solution you found?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Maximiliano Lopes&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 10:57:43 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/JS-Error-Invalid-type-passed-for-ChartSeriesActions-after/m-p/274050#M1363</guid>
      <dc:creator>MaximilianoML</dc:creator>
      <dc:date>2025-04-01T10:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: JS Error | Invalid type passed for ChartSeriesActions after refactoring into a component</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/JS-Error-Invalid-type-passed-for-ChartSeriesActions-after/m-p/274351#M1367</link>
      <description>&lt;P&gt;I think I already shared it&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt; ... refactor the whole chart as a component instead of the series action&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 12:39:18 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/JS-Error-Invalid-type-passed-for-ChartSeriesActions-after/m-p/274351#M1367</guid>
      <dc:creator>andycarlson</dc:creator>
      <dc:date>2025-04-03T12:39:18Z</dc:date>
    </item>
  </channel>
</rss>

