I want to make a chart for accumulated test results
Is there a way to use the script language to achieve this?
最佳答案
S
SystemWeaver
说
超过7年 以前
Below is a simple example using the configurable charts to achieve this. The example uses the following model:
A workarea containing documents and sections. Each section
has an attribute containing a status. The chart will show each document and the
amount of sections having ‘OK’ and not ‘OK’ statuses.
Applying the following script on the workarea:
<Charts>
<AreaChart>
<Slices>
<Slice name="first" caption="OK" color="green"/>
<Slice name="second" caption="Not OK" color="red"/>
</Slices>
<!-- For each document -->
<ForEachPart type="IDI">
<DefObj>
<!-- the counter make up each entry on the x axis -->
<Counter name="#{Name}" caption="#{Name}">
<!-- filter out all sections with attribute value 'OK' -->
<ForEach select="/IRRS[@PTCS='OK']">
<AddToSlice name="first"/>
</ForEach>
<!-- filter out all sections that have attribute value seperate from 'OK' -->
<ForEach select="/IRRS[not @PTCS='OK']">
<AddToSlice name="second"/>
</ForEach>
</Counter>
</DefObj>
</ForEachPart>
</AreaChart>
</Charts>
Gives the following result:
Using
an <AreaChart> will give an Area chart. The counter represents each entry
on the x axis. Adding sections with specific properties to the counter makes up
the height of each area.
Below is a simple example using the configurable charts to achieve this. The example uses the following model:
A workarea containing documents and sections. Each section
has an attribute containing a status. The chart will show each document and the
amount of sections having ‘OK’ and not ‘OK’ statuses.
Applying the following script on the workarea:
<Charts>
<AreaChart>
<Slices>
<Slice name="first" caption="OK" color="green"/>
<Slice name="second" caption="Not OK" color="red"/>
</Slices>
<!-- For each document -->
<ForEachPart type="IDI">
<DefObj>
<!-- the counter make up each entry on the x axis -->
<Counter name="#{Name}" caption="#{Name}">
<!-- filter out all sections with attribute value 'OK' -->
<ForEach select="/IRRS[@PTCS='OK']">
<AddToSlice name="first"/>
</ForEach>
<!-- filter out all sections that have attribute value seperate from 'OK' -->
<ForEach select="/IRRS[not @PTCS='OK']">
<AddToSlice name="second"/>
</ForEach>
</Counter>
</DefObj>
</ForEachPart>
</AreaChart>
</Charts>
Gives the following result:
Using
an <AreaChart> will give an Area chart. The counter represents each entry
on the x axis. Adding sections with specific properties to the counter makes up
the height of each area.
If a column chart is preferred, the configuration would be the same as described above except you would replace the <AreaChart> tag with <ColumnChart>.
<Charts>
<ColumnChart>
<Slices>
<Slice name="first" caption="OK" color="green"/>
<Slice name="second" caption="Not OK" color="red"/>
</Slices>
<!-- For each document -->
<ForEachPart type="IDI">
<DefObj>
<!-- the counter make up each entry on the x axis -->
<Counter name="#{Name}" caption="#{Name}">
<!-- filter out all sections with attribute value 'OK' -->
<ForEach select="/IRRS[@PTCS='OK']">
<AddToSlice name="first"/>
</ForEach>
<!-- filter out all sections that have attribute value seperate from 'OK' -->
<ForEach select="/IRRS[not @PTCS='OK']">
<AddToSlice name="second"/>
</ForEach>
</Counter>
</DefObj>
</ForEachPart>
</ColumnChart>
</Charts>
The result would be:
2 人 点赞
I
Inactive VCC contacts
说
将近7年 以前
Hello. I have noticed in a "R24 (20656)" release an interesting feature: <ColumnChart> which should solve the original issue with accumulated chart in a more straight-forward way. Any chance for update in this thread, @Martin?
SystemWeaver Support
说
将近7年 以前
Hello Jakub! I think our paths crossed a bit. I have updated this topic to include the column chart example. Let us know if you need anything else!
Liquid error: translation data {:other=>"%{count} 人 "} can not be used with :count => 1. key 'one' is missing.
I
Inactive VCC contacts
说
将近7年 以前
Ha! I should update the window before writing my previous post!
One more question in that case: Let's say we have "doc" items in a 3 different versions (e.g. 1,2,3), which we would like to include to that chart instead of using already available tools to compare different versions. Is there any variant-handling feature that we could us in that case?
SystemWeaver Support
说
将近7年 以前
Yes, you can handle versions. Using the same example, the configuration would look like this:
<Charts>
<ColumnChart>
<Slices>
<Slice name="first" caption="OK" color="green"/>
<Slice name="second" caption="Not OK" color="red"/>
</Slices>
<!--AllVersions: Returns all versions of an item.-->
<ForEach select="AllVersions">
<Counter name="#{Name}" caption="#{Name} Version: #{Version}">
<!-- For each document -->
<ForEachPart type="IDI">
<DefObj>
<!-- the counter make up each entry on the x axis -->
<!-- filter out all sections with attribute value 'OK' -->
<ForEach select="/IRRS[@PTCS='OK']">
<AddToSlice name="first"/>
</ForEach>
<!-- filter out all sections that have attribute value seperate from 'OK' -->
<ForEach select="/IRRS[not @PTCS='OK']">
<AddToSlice name="second"/>
</ForEach>
</DefObj>
</ForEachPart>
</Counter>
</ForEach>
</ColumnChart>
</Charts>
With the result being:
As you can see, I updated the PTCS results a bit to illustrate a difference.
Liquid error: translation data {:other=>"%{count} 人 "} can not be used with :count => 1. key 'one' is missing.
I
Inactive VCC contacts
说
将近7年 以前
Perfect, thanks a lot!
I
Inactive VCC contacts
说
将近7年 以前
I managed to adopt feedback from this thread and finally different versions are correctly listed on my chart. However, it becomes difficult to generate the proper graphs when I have to deal with different versions within a longer tree structure. Is there any possibility to compare e.g. time of release and create those graphs based on that (by reference to sth like "version attribute: date of release")?
B
Bashar Nassar
说
将近7年 以前
Hi
Jakub,
I
think one of the following path query methods or a combination of them would
serve your need (you can find more information on the Help manual).
VersionNumber
returns the version number of an item.
Liquid error: translation data {:other=>"%{count} 人 "} can not be used with :count => 1. key 'one' is missing.
I
Inactive Volvo Penta
说
将近6年 以前
Hello,
Is there any way to show the counter caption on the x axis only and not once per slice in the bar chart? The chart area gets a bit crowded for charts with several counters and slices. And is it possible to have x axis captions rotated as in the top picture of this article?
B
Bashar Nassar
说
将近6年 以前
Hello David,
Currently in SystemWeaver you can only configure the content of charts (PieChart, AreaChart and ColumnChart) not how they look like. So in short, no it is not possible to show the counter caption on the x axis only.
SystemWeaver
I want to make a chart for accumulated test results
Is there a way to use the script language to achieve this?
Below is a simple example using the configurable charts to achieve this. The example uses the following model:
A workarea containing documents and sections. Each section has an attribute containing a status. The chart will show each document and the amount of sections having ‘OK’ and not ‘OK’ statuses.
Applying the following script on the workarea:
Gives the following result:
Using an <AreaChart> will give an Area chart. The counter represents each entry on the x axis. Adding sections with specific properties to the counter makes up the height of each area.- 最早在前
- 热门
- 最新在前
Sorted by 最早在前SystemWeaver
Below is a simple example using the configurable charts to achieve this. The example uses the following model:
A workarea containing documents and sections. Each section has an attribute containing a status. The chart will show each document and the amount of sections having ‘OK’ and not ‘OK’ statuses.
Applying the following script on the workarea:
Gives the following result:
Using an <AreaChart> will give an Area chart. The counter represents each entry on the x axis. Adding sections with specific properties to the counter makes up the height of each area.SystemWeaver
The example used above is attached to this post.
SystemWeaver Support
If a column chart is preferred, the configuration would be the same as described above except you would replace the <AreaChart> tag with <ColumnChart>.
The result would be:
2 人 点赞
Inactive VCC contacts
Hello. I have noticed in a "R24 (20656)" release an interesting feature: <ColumnChart> which should solve the original issue with accumulated chart in a more straight-forward way. Any chance for update in this thread, @Martin?
SystemWeaver Support
Hello Jakub! I think our paths crossed a bit. I have updated this topic to include the column chart example. Let us know if you need anything else!
Inactive VCC contacts
Ha! I should update the window before writing my previous post!
One more question in that case: Let's say we have "doc" items in a 3 different versions (e.g. 1,2,3), which we would like to include to that chart instead of using already available tools to compare different versions. Is there any variant-handling feature that we could us in that case?
SystemWeaver Support
Yes, you can handle versions. Using the same example, the configuration would look like this:
With the result being:
As you can see, I updated the PTCS results a bit to illustrate a difference.
Inactive VCC contacts
Perfect, thanks a lot!
Inactive VCC contacts
I managed to adopt feedback from this thread and finally different versions are correctly listed on my chart. However, it becomes difficult to generate the proper graphs when I have to deal with different versions within a longer tree structure. Is there any possibility to compare e.g. time of release and create those graphs based on that (by reference to sth like "version attribute: date of release")?
Bashar Nassar
Hi Jakub,
I think one of the following path query methods or a combination of them would serve your need (you can find more information on the Help manual).
VersionNumber returns the version number of an item.
Example:
Max returns the maximum value in a set of integer values.
Example:
MaxByDate() returns the objects from the list with the latest date property (required SystemWeaver R24).
Example:
Best Regards,
Bashar
Inactive Volvo Penta
Hello,
Is there any way to show the counter caption on the x axis only and not once per slice in the bar chart? The chart area gets a bit crowded for charts with several counters and slices. And is it possible to have x axis captions rotated as in the top picture of this article?
Bashar Nassar
Hello David,
-
Comparing two versions of a structure
-
Context and path language
-
Overview of meta model
-
Importing old data
-
Cannot find multiple version items
-
Cannot remove part - is referenced
-
View of non accessable data
-
Path: How to check if an attribute is empty?
-
List and path language
查看所有33话题