Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: EAButNotForGames on July 24, 2024, 06:33:12 pm
-
I am currently working on a script to autogenerate Charts in Diagrams.
I am struggeling to excess the Type and the Series in "Chart Details".
Does anybody have an idea if and how I can excesses those.
-
All that info is stored in xml format in the notes of the tagged value ChartProperties
Here's an example of one of my charts:
<chart type="piechart">
<source customSQL="select case when isnull(o.stereotype, '') = 'KPI_report' then 'Nieuwe Stijl' else 'Oude Stijl' end as Series
from t_object o
inner join t_package p on p.package_ID = o.Package_ID
inner join t_package p2 on p2.Package_ID = p.Parent_ID
left join t_package p3 on p3.Package_ID = p2.Parent_ID
left join t_package p4 on p4.Package_ID = p3.Parent_ID
left join t_package p5 on p5.Package_ID = p4.Parent_ID
where o.object_Type = 'Screen'
and '{C60A3CFB-8E2C-4666-9544-0BA3F369BF89}' in (p.ea_guid, p2.ea_guid, p3.ea_guid, p4.ea_guid, p5.ea_guid)"/>
<appearance category="0" gradient="0" showindexinlabels="0" exploded="0" showdatalabels="1" fitinarea="0" labelPosition="0" holesize="50" displaylegend="0" rotationAngle="0" pieAngle="45"/>
</chart>
Geert
-
I seems like I got a weird bug.
I create the chart with a script
When I open the diagram, I can only see an empty Standard Chart element
But when I copy the ChartProperties (which i generated with the script) into a new Standard Chart element by hand, the new element displays everything as expected
How peculiar
-
Even weirder:
When I open the ChartProperties of the empty looking Chart and just push enter at the end of the Notes the Chart generates properly!?
-
I guess you'll have to figure out what is different. There will be something different between a chart freshly created by your script, and a chart where you hit enter in the notes.
In cases like this I usually make two objects (one that works, and one that is broken) and then inspect the database, comparing both elements field by field.
I would start looking in
- t_objectproperties
- t_object
- t_xref
- t_diagramObject
Geert