When working with charts that support displaying a timeline (usually a Temporal Evolution Chart
with an attribute byTime
set to true
), the x-axis can be customised to display the level
of details that suits you best. The following attributes can be used:
timeInterval
(optional, default: MILLISECOND) displays only the last value available for the time period selected. This allows you to display a result trend for the past year where only the last of every month is drawn on the chart (onlyLast="12" timeInterval="MONTH"
). The values allowed for this attribute are MILLISECOND
, SECOND
, MINUTE
, HOUR
, DAY
, WEEK
, MONTH
, QUARTER
and YEAR
. Note that for Temporal Evolution Chart with a BAR
renderer, this setting defines the width of the bar.
timeAxisByPeriod
(optional, default: false) allows labelling the x-axis with periods of time (true) instead of actual dates (false). The minor and major labels displayed are specified by the timePeriodMinorTick
and timePeriodMajorTick
attributes below.
timePeriodMinorTick
(optional, default: auto) defines the interval at which minor ticks are drawn on the chart. The values allowed are the same as for the timeInterval
attribute.
timePeriodMajorTick
(optional, default: auto) defines the interval at which major ticks are drawn on the chart. The values allowed are the same as for the timeInterval
attribute.
By default, the date used for each version is the actual date of when the analysis was run. However, you can override this date and specify the real date of an analysis in the UI using the Version Date field, or via the command line using the versionDate parameter. Refer to the Command Line Interface and the Online Help for more details.
You can display future or past versions on a chart using the forecast
element on a measure, as shown below.
<chart type="TemporalEvolution" width="600" height="400" renderer="BAR" id="TE_BAR_FORECAST"> <measure color="0,81,0" label="Lines of Code">LC <forecast> <version value="SLOC" timeValue="DATE(2016,06,30)" label="V7 forecast" /> <version value="600" timeValue="DATE(2016,07,31)" /> <estimatedVersion timeValue="DATE(2016,08,31)" /> <estimatedVersion timeValue="DATE(2016,09,30)" /> </forecast> </measure> </chart>
The forecast points on the chart can be:
The forecast
element accepts the following attributes:
degree
(optional, default: 1) sets the degree
of the polynomial extrapolation used to compute estimated values at a specific date. Supported values are:
1 for linear
2 for quadratic
3 for cubic
minNb
(optional, default: 2) sets the minimum
number of past values to take into account to estimate future values
maxNb
(optional, default: 5) sets the maximum
number of past values to take into account to estimate future values
When using forecast
with dynamically estimated future values,
use the estimatedVersion
element with the following attributes:
When using forecast
with hard coded values for, use the
version
element with the following attributes:
value
(mandatory) is a computation valid for the current artefact type (same limitation as for displayOnlyIf
).
timeValue
(mandatory) is a computation valid for the current artefact type that is used to position the version on a time axis. The result has to be a number of milliseconds since January 1st 1970.
label
(optional, default: V(n+x)) is the label used to represent the
version on the chart.
Displaying estimates for dynamically for the next 6 months is more efficient with chart where values are plotted according to when they were created on a time axis (see the section called “Time Axis Configuration”) and can be done as shown in the following example:
<chart type="TE" byTime="true" timeInterval="WEEK" width="600" height="400" id="TEMPORAL_EVOLUTION_PROJECTION"> <measure label="Lines of Code" color="0,81,0">LC</measure> <measure stroke="DOTTED" label="Lines of Code (forecast)" color="0,81,0">LC <forecast> <estimatedVersion timeValue="CURRENT_VERSION_DATE+DAYS(30)" /> <estimatedVersion timeValue="CURRENT_VERSION_DATE+DAYS(60)" /> <estimatedVersion timeValue="CURRENT_VERSION_DATE+DAYS(90)" /> <estimatedVersion timeValue="CURRENT_VERSION_DATE+DAYS(120)" /> <estimatedVersion timeValue="CURRENT_VERSION_DATE+DAYS(150)" /> <estimatedVersion timeValue="CURRENT_VERSION_DATE+DAYS(180)" /> </forecast> </measure> </chart>
CURRENT_VERSION_DATE
is a metric defined in the analysis model as follows:
<Measure measureId="CURRENT_VERSION_DATE" defaultValue="-1"> <Computation targetArtefactTypes="FILES;CLASSES;MODULES;CODE_SPECIFICATIONS" result="VERSION_DATE()" /> </Measure>
On a Temporal Evolution Chart, you can render goals graphically by defining a starting point, an end date and a value
you want to reach. This is done using the goal
element on your chart, and replaces the
deprecated Temporal Evolution Line With Goal and Temporal Evolution Bar With Goal charts.
<chart type="TE" id="TE_LINE_WITH_GOAL_FIRST_VERSION_AREA" byTime="true"> <dataset renderer="AREA"> <goal color="#85B602" alpha="100" label="My Objective"> <forecast> <firstMeasureVersion id="LC" /> <version value="8000" timeValue="DATE(2014,10,01)" /> </forecast> </goal> </dataset> <dataset renderer="LINE"> <measure color="0,81,0" label="Line of Code">LC <forecast> <version value="SLOC" timeValue="DATE(2014,05,01)" label="V3" /> <version value="6666" timeValue="DATE(2014,06,01)" /> <version value="3333+4444" timeValue="DATE(2014,08,01)" /> </forecast> </measure> </dataset> </chart>
In the example above, the first dataset (rendered as an AREA
) is used for the goal, while the second
(rendered as a LINE
) is used for the display of the LC metric.
The goal
element supports the color
, label
and alpha
attributes as they are described in the section called “Common Attributes for measure
and indicator
”.
It accepts a child forecast
element with one or more traditional version
elements
(as described in the section called “Displaying Planned Versions”), as well as an optional firstMeasureVersion
attribute
that will define the starting point to draw the goal. In the example above, the goal is rendered the first time that the metric LC has
a value and is drawn using the value of this metric at this point in time. The goal to reach is hard-coded to 8000 on October 1st 2014,
but you could use any metrics from you model to generate dynamic values.
Using goals, you can easily draw burn down charts for you agile projects.
<chart type="TE" id="BURN_DOWN_CHART" byTime="TRUE" timeInterval="DAY"> <dataset renderer="STEP"> <measure color="RED" alpha="200" label="Remaining Tasks">NUM_TASKS</measure> </dataset> <dataset renderer="LINE"> <goal color="GREEN" alpha="100" label="Objective"> <forecast> <firstMeasureVersion id="NUM_TASKS" /> <version value="0" timeValue="SPRINT_START + DAYS(C.SPRINT_LENGTH)" /> </forecast> </goal> </dataset> </chart>
In this example, we start drawing the diagonal when NUM_TASKS first has a value for the project, and set the objective to reach zero by dynamically computing the end of the sprint based on the sprint start date and a constant that defines the sprint length.