LineDashStyle: String;
The LineDashStyle property determines series line drawing style.
Use JSON to set the property value and the getLineDashStyle method to get the property value.
Available values:
Solid. Straight line.
Dash. Dashed line.
Executing the example requires the web application with opened instance of express report, with selected chart of line type. It is required to enter code in the console:
// Get chart instance
dView = PP.App.getModuleObject().getReportBox().getDataView();
chart = dView.getChartView().getInstance();
// Get the first data series
oldSerie = chart.getSeries()[0];
// Get data series settings
newSerie = oldSerie.getSettings();
// Determine properties for the new series
newSerie.LineDashStyle = "Dash";
// Set line break coefficient
newSerie.LineBreak = 0.5;
// Set trend line for the new series
trend = {
BackwardForecast: 0,
Color: "rgb(0,0,0)",
Enabled: true,
ForwardForecast: 0,
LineDashStyle: "Dash",
LineWidth: 1,
Name: "Linear trend",
PeakInterval: 12,
ShowInLegend: true,
Type: "Linear",
UseAutomaticText: true
};
newSerie.TrendLine = trend;
// Check if appearance is animated
console.log(oldSerie.getIsNewborn() ? "IsNewborn = true" : "IsNewborn = false")
// Check attribute of animated deletion
console.log(oldSerie.getMarkedForDeath() ? "MarkedForDeath = true" : "MarkedForDeath = false")
// Change series index in legend
newSerie.LegendIndex = 3;
// Enable series shadow display
newSerie.Shadow.Enabled = true;
// Set color and width of pressed line
newSerie.InsetColor = "rgba(130, 16, 182, 1.000000)";
newSerie.InsetLineWidth = 1;
// Change settings of the line that replaces empty values
newSerie.EmptyLine.LineWidth = 3;
// Change smoothing coefficient
newSerie.ApproximationPixelCoef = 1;
// Add a new series
chart.addSerie(newSerie);
After executing the example a new series with alternative settings containing trend line was added.
See also: