I’m trying to make a dashboard type of page for a customer and I’m running into a couple of things with the XYChart that is making me tear my hair out.
I’ve created a widget that is a flex column container, added a label as a title, and then an XYChart to display various numbers of data points in a bar chart configuration. When that widget is added to a flex screen, I’m trying to get that widget to resize based on the chart. However, it seems that the chart is resizing based on the flex container it is in rather than the other way around. Is this the expected behavior? Is there any way to get the chart to resize based on it’s needs and then make the flex container resize appropriately with a bias of auto/content? These charts are going to be different based on the data supplied to them, and I’m just trying to keep them legible both in a mobile fashion as well as in a desktop fashion.
Are you looking to resize the widget in the dashboard based on the data in the xychart?
You might be able to have an output parameter in the view of your xychart and bind that to the position object of the widget in the dashboard.
Yes I’m looking to resize the outer flex container based on the chart needed size based on the data being loaded in the chart as it is dynamic.
Much like if I load data into say a label, and that label needs to grow I can set the label bias to auto and set the outer flex container to auto and the outer flex will grow based on the contents of the container. It just seems that the chart is constraining itself to the container… and maybe that is by design and I’ll need to do as you say with the out parameter.
Yeah the xychart is constrained to the view or flex container, and the view a widget uses is being constrained by the dashboard properties.
ok… that’s what I thought.
This XYChart is powerful but tough to use with an unknown number of series etc… at design.
I would use a scripting route to configure your charts. Bindings in such a power component gets too complicated and hard to track. Just bind the data in the chart.
Use a startup script to setup X and Y axis, cursors, series, and labels.
You can use a change script if you want to hide or unhide series that can be triggered by a flex container with some buttons with series names.
Yeah I’m working through it… I’m trying to learn this XY Chart as my customer wants a TON of bar charts… with a different color for each value and a legend etc… All coming from a database with data that will change from day to day.