Home
Analytics
Milestone Trend Analysis (MTA) chart
thommy2911
Hello everyone,
does anyone have some hints, how to get the "standard line" in an MTA chart? I mean the light blue diagonal line in the attached image.
Thanks in advance,
Thomas
Find more posts tagged with
Comments
mwilliams
Hi Thomas,
Can you explain more of what you're trying to achieve? How do you figure the line?
thommy2911
Hi Michael,
the chart shows for each reporting date (x-axis) the planned date for each not-yet-reached major milestone in the project (y-axis). Once a milestone is reached the line ends. If plans remain unchanged all milestone lines go horizontally; once a planned milestone date is postponed the line goes up. Once a line breaks through the standard line, it indicates that replanning is necessary since a not-yet-reached milestone should have been reached in the past.
So, the standard line has data points on (a; a), i.e. x-axis value = y-axis value.
My questions are actually:
(a) Can I have two chart types in one diagram (one for the milestone lines, one for the standard line)?
(b) Should I generate data points for the standard line? I could imagine that the line would not look straight anymore once the scaling of the axes is not exactly the same.
Do my explanations make sense to you?
Thanks,
Thomas
mwilliams
Thomas,
Yes, I understand what you're looking for much better now.
(a): Yes, you can have two chart types in a single chart diagram. If you enter a second series in the "Select Data" section of the chart editor, when you go to the "Format Chart" Section, you'll have drop downs next to the series names on the "Series" section of the "Format Chart" tab for changing the chart type.
(b): Yes, you'll probably need to generate data points to get this line. You could adjust the scaling on the axises of the chart, on the format chart tab, to make the line appear straighter.
Hope this helps.
thommy2911
to b) How can I actually generate data sets with BIRT? The data we retrieve from the database has three columns: name, tscreate, and milestonedate. tscreate is set to x axis (reporting dates), milestonedate to y axis, and y series grouping is set to name.
So, I would need to generate data sets (name="standardline") same entries each for tscreate and milestonedate. Do I need to write a script for the "After Open" function? How?
mwilliams
Thomas,<br />
<br />
You could either enter the line info in a csv file and use the flat file datasource option in BIRT or create a scripted dataSource. If you want to create a scripted dataSource, check out the following posts from the devShare:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/544-sample-birt-scripted-data-source-example/#description'>Sample
BIRT Scripted Data Source Example - Designs & Code - BIRT Exchange</a><br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/255-birt-scripted-datasource-example-design/#description'>BIRT
Scripted DataSource Example Design - Designs & Code - BIRT Exchange</a><br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/230-birt-scripted-data-source-tips/#description'>BIRT
Scripted Data Source Tips - Tips & Tricks - BIRT Exchange</a>
mwilliams
Thomas,
Also, depending on how your dataSet is set up, you may be able to just create the line data in a computed column in your dataSet.
thommy2911
Michael,
thanks for the help so far. A computed column won't help. I need to generate data rows. Is this possible for a data set in the onFetch method?
If I put
row["name"] = "standardline";
row["tscreate"] = new Date();
row["milestonedate"] = new Date();
for testing, it doesn't work :-(
thommy2911
A different approach than generating rows for the standard line would be the following:
We've set tscreate as second axis, so a line shows up. We could hide the legend by making the line itself transparent, only showing the shadow (little tricky but works).
But now we have the problem that both lines must have the same scaling, otherwise the standard line lies over the other.
Is it somehow possible to set min and max via scripting? How do I get to setMax() function of IScale?
mwilliams
Thomas,
The setMax() function can be called in this chart script.
function beforeDrawAxisLabel( axis, label, icsc )
{
axis.getScale().setMax()
}
thommy2911
Hi Michael,
great, that's what I'm looking for.
However, I'm stuck again. Function setMax requires an DateElement as parameter. How do I import and initialize the required data structures?
function beforeDrawAxisLabel(axis, label, icsc) {
max = new Date(2009,11,1);
elem = new org.eclipse.birt.chart.model.data.DateTimeDataElement();
elem.setValue(max.getTime());
axis.getScale().setMax(elem);
}
Also, if I have a secondary axis configured, how do I separate between both axes. To which axis is the variable "axis" referring to?