Class: Lines

CIQ.Renderer. Lines

new Lines(config)

Creates a Lines renderer.

This renderer will draw lines of various color, thickness and pattern on a chart.

The Lines renderer is used to create the following drawing types: line, mountain, baseline, wave, step chart, and colored versions of these. Note: by default the renderer will display lines as underlays. As such, they will appear below any other studies or drawings.

See CIQ.Renderer#construct for parameters required by all renderers

Name Type Description
config object

Config for renderer

Name Type Argument Description
params object <optional>

Parameters to control the renderer itself

Name Type Argument Default Description
width number <optional>

Width of the rendered line

type string <optional>

Type of rendering "line", "mountain", "wave"

useChartLegend boolean <optional>

Set to true to use the built in canvas legend renderer. See CIQ.ChartEngine.Chart#legendRenderer;

highlightable boolean <optional>

Set to false to prevent selection of series via hover

style string <optional>

Style name to use in lieu of defaults for the type

step boolean <optional>

Specifies a step chart

baseline boolean <optional>

Specifies a baseline chart

colored boolean <optional>

Specifies the use of a colorFunction to dictate color of the segment

vertex boolean <optional>

Specifies drawing a dot on every vertex

vertex_color boolean <optional>

Specifies a color for the vertices. If omitted, will use defaultColor.

colorFunction string <optional>

Override string (or function) used to determine color of bar. May be an actual function or a string name of the registered function (see CIQ.Renderer.registerColorFunction)

Common valid parameters for use by attachSeries. See also CIQ.ChartEngine#plotLine:
color - Specify the color for the line in rgba, hex or by name.
pattern - Specify the pattern as an array. For instance [5,5] would be five pixels and then five empty pixels.
width - Specify the width of the line.
baseColor - Specify the color of the base of a mountain.
fillStyle - Specify an alternate color to fill a mountain (other than color).


  • • 4.0.0 - New `config.params.useChartLegend` added
    • 5.1.0 removed subtype parameter, this will be determined internally from config.params.step=true
    • 5.1.0 added highlightable, overChart, step, baseline, vertex, style, colored, and colorFunction parameters
// add multiple series and attach to a custom y-axis on the left.
	// See this example working here :

	// note how the addSeries callback is used to ensure the data is present before the series is displayed

	//create the custom axis
	var axis=new CIQ.ChartEngine.YAxis();
	axis.decimalPlaces=0;			// no decimal places on the axis labels
	axis.maxDecimalPlaces=0;		// no decimal places on the last price pointer

	//create the renderer
	var renderer=stxx.setSeriesRenderer(new CIQ.Renderer.Lines({params:{name:"lines", type:"mountain", yAxis:axis}}));

	// create your series and attach them to the chart when the data is loaded.
	stxx.addSeries("NOK", {display:"NOK",width:4},function(){
		renderer.attachSeries("NOK", "#FFBE00").ready();

	stxx.addSeries("SNE", {display:"Sony",width:4},function(){
		renderer.attachSeries("SNE", "#FF9300").ready();
// This is an example on how completely remove a renderer and all associated data.
		// This should only be necessary if you are also removing the chart itself.

		// remove all series from the renderer including series data from the masterData

  		// detach the series renderer from the chart.

  		// delete the renderer itself.
// Colored step baseline mountain with vertices
		var renderer=stxx.setSeriesRenderer(new CIQ.Renderer.Lines({params:{name:"lines", type:"mountain", baseline:true, step:true, colored:true, vertex:true, yAxis:axis}}));



Returns a new Lines renderer if the featureList calls for it FeatureList should contain whatever features requested; valid features: line, mountain, baseline (delta), step, vertex, colored, wave Anything else is an invalid feature and will cause function to return null Called by CIQ.Renderer.produce to create a renderer for the main series

Name Type Argument Description
featureList array

List of rendering terms requested by the user, parsed from the chartType

config.params object <optional>

Parameters used for the series to be created, used to create the renderer

  • 5.1.0

A new instance of the Lines renderer, if the featureList matches