Skip to main content
Solved

Create a chart by group id in a Custom transformer


felipeverdu
Enthusiast
Forum|alt.badge.img+10

I have a input data file with a unique ID (BORRHAL_NR) with 2 variables (Date/Granvattenniva). I am using a python caller in a CT to generate a chart with matplotlib.

I would like to produce as many charts as unique IDs, and I am using the group by in the custom transformer but even though it produces in this case 4 charts I see that is using all data from all unique IDs in those charts (except for the first one that is actually correct).

Any ideas?

I am using FME 2022.2.4. (Build 22792)

Best answer by treid

If I am understanding what you are trying to achieve correctly, perhaps you could use the ChartGenerator transformer which has a built in Group By option? See the attached workspace, it generates a unique chart for each unique BORRHAL_NR ID with one data series per chart. You might want to tweak the settings in the ChartGenerator but I hope this achieves roughly what you want.

 

 

View original
Did this help you find an answer to your question?

4 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

Not sure, but it might have to do how the Group By parameter is created? When I create this, it is a checkbox option, not a choice list.

 

When I create the Group By parameter in a Custom transformer, in the Custom transformer, in the Navigator window, I click right mouse button on Group By and choose Create User Parameter. It then becomes a checkbox.


felipeverdu
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • October 25, 2023

Hi @nielsgerrits​ 

I did so as you described, but I am still getting mixed charts :(


treid
  • Best Answer
  • October 27, 2023

If I am understanding what you are trying to achieve correctly, perhaps you could use the ChartGenerator transformer which has a built in Group By option? See the attached workspace, it generates a unique chart for each unique BORRHAL_NR ID with one data series per chart. You might want to tweak the settings in the ChartGenerator but I hope this achieves roughly what you want.

 

 


felipeverdu
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • October 30, 2023

Hi @treid​ 

Thanks for the reply and your time.

The reason why I wanted to use your with matplot is the nicest layout produced there instead for using chartgenerator that it will do the job but it is harder to get a nice chart :).

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings