Charts - dynamic series line chart

0
Hi Community, I am using the Charts widget in a test project.  I’ve followed the page “create a dynamic series chart” and this works as advertized. Then I am attempting to do the same with a line chart one, and this does not work. The error is “Configuration error in widget underfined: Dynamic series – Series entity in MyFirstModule.Series in ‘series’ should be the same as MyFirstModule.Value, or a reference of MyFirstModule.Value. The line chart widget is in the same data view as described in the dynamic series chart recipe, which is running a DS_Value microflow that retrieves a Value object from the database. I’ve seen this also have a Create Object. The microflow does not create a link to the Series entity for this Value object but there are links to Series objects in the Value entries I made in the sample data, where I created Series objects and then added Value objects and linked them to a Series. I’ve also seen written somewhere in the internet that dynamic series in line charts do not work (when using the Mendix provided Charts one and not anychart). Any guidance on how to make dynamic series work in the line chart widget? I know how to make it work with hard coded static value series in the chart definition but that is not how I hoped to use the line chart widget.
asked
2 answers
1

HI,
You can try to Use Any chart widget from Mendix . Create a NP Entity A and add a String Attribute of length Unlimited. Now  in your DS microflow Create Entity A  and build your Json Structure of the chart you wanted to display in microflow and map the Json Structure to the Attribute in Entity A. 
 

Hope this Helps!!

answered
1

I will add my own answer as well.

Turns out I found something in the documentation page “Create a Dynamic Series Chart” that was easy to overlook, but there if scrutinized deeply (come on Mendix, we need a bit more “worded” clarity in the page sometimes :-)).

Section 3.1 shows one must set up two entities, Value and Series.

Later on, section 4.2.7 asks us to set a link to the Series in the Dynamic series tab. The words say one needs to pick the Series entity, which is possible in the selection. However, and this is what I overlooked, in the picture underneath it, you can see that the Series entity needs to be approached via a reference from the Value entity!

That was the trick one can easily miss. This will work for most all chart types (except where dynamic series are not supported). When you do this, the error mentioned in my question above also disappears.

Now what I am still curious about is how I set the context for the Value entity in the microflow. Do I select any first Value from the database, or do I create just an empty one? (so far I do the “select the first one” approach). Why would an empty one also just work? how about if I want just a sub-set (yes, yes, the xPath and microflow option, I am aware, but more details and examples in the documentation sure would save a lot of time, Mendix people again?)

answered