When working with charts that support displaying a timeline (Temporal Evolution Line Chart and Temporal Evolution Bar Chart charts
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 Bar Chart charts, 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="TemporalEvolutionBar" width="600" height="400" 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:
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>