the trending calculation itself does not take null values into account.
However, if you prefer not to show trend points for which "application" was null, you can hide the line segments passing through those points by using an extension point:
trendLine_strokeStyle: function(s) {
var categ = s.getCategory(),
series = s.getSeries(),
dataPart = '0',
hasNonNull =
this.chart.visibleData(dataPart)
.datums({category: categ, series: series}, {isNull: false})
.any();
// `delegate` returns the color that would be returned hadn't we overridden
// the extension point.
// `null` means "transparent color".
return hasNonNull ? this.delegate() : null;
}
The previous code snippet works for a default chart configuration, where you used the default dimension names (series and category), and the trend is only for the data in the main plot (the data with dataPart value '0'
).
For the other question, of how to hide the part of the legend that shows the trend colors, assuming once again that you did not change default values, and so that the trend plot is using the second color axis, you'd hide it by specifying the option color2AxisLegendVisible: false
.
Edit: To place the code above in the CDF component's preExecution handler, you'd do it like this:
function() {
var cccOptions = this.chartDefinition;
// Extension points are in a array of pairs name, value format...
var eps = Dashboards.propertiesArrayToObject(cccOptions.extensionPoints);
// Specify the extension point
eps.trendLine_strokeStyle = function() { ... };
// Convert extension points to original CDF format
cccOptions.extensionPoints = Dashboards.objectToPropertiesArray(eps);
}