How to add a 'output bar chart' in the Dashboard using code

How to add a 'output bar chart' in the Dashboard using code

lancewu
Not applicable
1,015 Views
6 Replies
Message 1 of 7

How to add a 'output bar chart' in the Dashboard using code

lancewu
Not applicable

[ FlexSim 22.1.4 ]

hi,

i am tyring to add a 'output bar chart' in the Dashboard by code ,Can code be used to achieve this command ? Thank you for your review。

0 Likes
Accepted solutions (1)
1,016 Views
6 Replies
Replies (6)
Message 2 of 7

julie_weller
Not applicable

Hi @lancewu! I think it would help us to know what you're trying to accomplish. Why don't you want to use the pre-defined output chart?

Message 3 of 7

lancewu
Not applicable

I'm writing a script that can automatically generate bar charts or another chart。 I know that there are some scripts that can be automatically generated dashboard or globaltable,I want to know if have code can be automatically generate chart。

0 Likes
Message 4 of 7

jason_lightfoot_adsk
Autodesk
Autodesk
Accepted solution

Here's a start:

Object dashview=views().find("active>Documents/Dashboard/1+/~");
Object chartview=views().find("viewslibrary/Dashboard/Output/ThroughputBar");
Object chart=function_s(dashview,"createGraphWindow",chartview,1);
Group group = getvarnode(chart,"replacements").subnodes["Objects"].value;
group.addMember(Model.find("Processor1"));
Object webgraph=dashview.find("GraphPanel").last;
webgraph.location=Vec3(200,200,0);
webgraph.size=Vec3(400,200,0);
refreshview(webgraph);


0 Likes
Message 5 of 7

lancewu
Not applicable
thanks! it worked!!
0 Likes
Message 6 of 7

lancewu
Not applicable

Hi, excuse me, I also want to have a chance to know how to set the size of the chart by code ;

Thank you for your review。

0 Likes
Message 7 of 7

jason_lightfoot_adsk
Autodesk
Autodesk
I updated the code above to adjust the size and location.
0 Likes