jqDataVisualization for jQuery Documentation

Chart.PlotLine


Defines axis plot line.

Sample configuration:

 var plotLineConfig = {
     lineWidth: 2,
     strokeStyle: 'green',
     value: 42,
     title: {
         text: 'Target 1',
         hAlign: 'right',
         fillStyle: 'green'
     }
 }

Example usage:

$(document).ready(function () {
      $('#selector').jqChart({
          title: { text: 'Plot Lines' },
          axes: [
              {
                  location: 'left',
                  type: 'linear',
                  plotLines: [
                      {
                          lineWidth: 2,
                          strokeStyle: 'green',
                          value: 42,
                          zIndex : 0,
                          title: {
                              text: 'Target 1',
                              hAlign: 'right',
                              fillStyle: 'green'
                          }
                      },
                      {
                          lineWidth: 2,
                          strokeStyle: 'red',
                          value: 72,
                          zIndex : 0,
                          title: {
                              text: 'Target 2',
                              hAlign: 'right',
                              fillStyle: 'red'
                          }
                      }
                  ]
              }
          ],
          series: [
              {
                  type: 'column',
                  data: [['A', 70], ['B', 40], ['C', 85], 
                         ['D', 50], ['E', 25], ['F', 40]]
              }
          ]
      }
  }
Defined By

Config options

Chart.PlotLine
: Number
Specifies the plot line width. ...

Specifies the plot line width.

Defaults to: 1

Chart.PlotLine
: String
Specifies the plot line color. ...

Specifies the plot line color.

Defaults to: 'gray'

Chart.PlotLine
: String/Common.Title
Specifies the plot line title. ...

Specifies the plot line title.

Defaults to: {margin: 2, hAlign: 'left', vAlign: 'top'}

Chart.PlotLine
: Number/Date

Specifies plot line value.

Specifies plot line value.

Chart.PlotLine
: Number
Specifies the plot line z-index. ...

Specifies the plot line z-index.

Possible values are:

  • 0 - Plot line is rendered below the grid lines.
  • 1 - Plot line is rendered above the grid lines and below the chart series.
  • 2 - Plot line is rendered above the chart series.

Defaults to: 0