EJSC.BarSeries.ranges

See Also: Using Colors

 

Definition

 

array ranges = new Array()

 

Description

 

This property is used to store the ranges for a given bar series.  The range objects are used to draw bars in varying styles based on their Y value.

 

The range objects stored are defined as:

 

       range = {

               min:                float, // >=

               max:                float, // <

               color:                string, // Defined as rgb(RED,GREEN,BLUE), ex: "rgb(255,0,0)"

               opacity:                integer, // Represents percent, i.e. 50 = 50%

               lineOpacity:        integer, // Represents percent, i.e. 50 = 50%

               lineWidth:        integer // Represents the line width in pixels

       }

 

Example

 

>> Define ranges so that bars with a Y value from 0 to 10 and 90 to 100 are colored red, bars 10 - 90 are colored green

 

var chart =  new EJSC.Chart("chart");

var bar = chart.addSeries(new EJSC.BarSeries(

   data,

   {

      ranges: [

         { 0, 10, "rgb(255,0,0)", 100, 100, 1 },

         { 90, 100, "rgb(255,0,0)", 100, 100, 1 },

         { 10, 90, "rgb(0,255,0)", 100, 100, 1 }

      ]

   }

));