Skip to main content
Solved

Chartgenerator show labels next to points?


jobvdnoort
Supporter
Forum|alt.badge.img+10

Hi,

 

Can someone help me with the Chartgenerator transformer.

 

As a result I plot a pdf that looks like this:

 

 

The only thing that I would like to do is to plot the values of the points as text labels next to the points. Like what was done before in EXCEL. 

 

Can anyone here help me to get labels next to my points?

 

Thanks in advance.

 

Best answer by debbiatsafe

Hello @jobvdnoort 

Unfortunately, the ChartGenerator doesn’t have a parameter that allows the user to specify adding data labels to the chart. I will an enhancement request to add support for this in the ChartGenerator.

There are several workarounds. FME ships the matplotlib Python library already so if you are familiar with Python, you can call matplotlib in a PythonCaller to create the charts.

An alternative that doesn’t require Python is to generate a scatter plot chart with the same parameters as the line chart, get the position of the points by extracting the data points from the raster as vector points, create text labels from the points, and then overlay them on the line chart using a VectorOnRasterOverlayer.

I have attached an example workspace demonstrating both approaches, and I hope it helps.

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

3 replies

debbiatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • Best Answer
  • July 10, 2024

Hello @jobvdnoort 

Unfortunately, the ChartGenerator doesn’t have a parameter that allows the user to specify adding data labels to the chart. I will an enhancement request to add support for this in the ChartGenerator.

There are several workarounds. FME ships the matplotlib Python library already so if you are familiar with Python, you can call matplotlib in a PythonCaller to create the charts.

An alternative that doesn’t require Python is to generate a scatter plot chart with the same parameters as the line chart, get the position of the points by extracting the data points from the raster as vector points, create text labels from the points, and then overlay them on the line chart using a VectorOnRasterOverlayer.

I have attached an example workspace demonstrating both approaches, and I hope it helps.


jobvdnoort
Supporter
Forum|alt.badge.img+10
  • Author
  • Supporter
  • July 10, 2024

@debbiatsafe 

Thank you for the 2 examples, this is exactly what I need!


debbiatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • January 15, 2025

I’m pleased to announce that support for adding data point annotations to Line, Scatter, Bar, or Pie chart types has been added to the ChartGenerator. This functionality can be found in FME 2024.2 (builds 24801 and higher).


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