Not being able to select the right attribute from graphs

0
Hi, i'm using mendix 10.9.0. I need help. I'm creating an app that gets data from a REST call and display them in a chart. The structure of the data that i recieve must be this: a list of cameras that have some attributes, including a list of images connected to that camera. It should sound easy on paper, but for some reason i can't figure out why i can't display all the data i need. Let me show you with some pictures:   Here's the JSON structure of the data that will arrive to my mendix app.   Here's the domain model of my app where each camera (Fotocamera) is related to multiple immages(Immagine):   Here's the import mapping that the REST call is using for importing the response:   And here's the microflow that executes the REST call: Now i think that this is the real issue. As you can see the REST call is returning a list of cameras (Fotocamera), since i told him that he'll receive a list of cameras conaining, for each camera, a list of images. However i need to display on my graph, for each cameras being a series, their corrisponding list of images. But i can't do that because when i go choosing the X and Y values, all i can see are the attributes of camera (Fotocamera), as you can see here:   I hope you understood what my problem is to advice me a solution. Thank you.
asked
3 answers
0

Hi Damiano Purin,

In Microflow you are Returning the Camera List, So in Line Chart you can only use that entity you cannot use the associated objects. Even if you retrieve the objects you cannot use them because you can only pass one entity at a time for the line chart Or create another non-persistable entity with x-axis and y-axis and store the details from call rest in this entity and pass this object list to Chart.

Try to use Any Chart it will have more options.

Thankyou.

answered
0

Hi Ganesh,

thank you for the reply.

I have to tell you that the fact that in charts you can't use associations it's not that true.

You see, in my case i couldn't use the associated object because my model was relating images and cameras in a one to many relation.

For some reason mendix counts that as kind of one way relation, so i can't acces the values of the images via the camera.

In fact, if i just attach a (theoratically wrong) relation like this:

image.png

 

I can now acces the data of the immages (immagine) from the lineChart:

image.png

 

I don't understand if this makes sense to you, because to me this seems like BS.

Also i did not understand the thing of the "chart that have more options", what do you mean by that, could you explain a bit better that topic?

Thank you!

answered
0

Hi Damiano Purin,

In mendix we can access association objects only from the Owner entity That's why you cannot access it in the original association. but you can access in the second because now camera is the owner association.

There is a widget called 'anychart' in mendix in that you will have more options.

Can you explain what you want to display in the chart so, i can understand better.

Thankyou.

answered