Wijmo UI for the Web
seriesList Field

Creates an array of series objects that contain data values and labels to display in the chart. Each series object consists of a label and a data attribute with its own array of X and Y values. X values are generally text values, while Y values are generally numeric.

See the Clustering Data topic for information on the concept of providing a cluster of numeric Y data values for the same set of X data values. Type: Array Default: []

Syntax
Javascript (Usage) 
var value; // Type: array
value = jQuery.wijmo.wijbarchart.options.seriesList;
Javascript (Specification) 
var seriesList : array;
Example
This code creates a chart with three series objects: USA, Japan, and Other, each with a set of three data values: Wii, XBOX360, and PS3. The third series has the legendEntry attribute set to false so that only the first two series objects appear in the legend, as in the image below.
<script id="scriptInit" type="text/javascript">
    $(document).ready(function () {
        $("#wijbarchart").wijbarchart({
            seriesList: [{
                label: "US",
                data: 
                { 
                    x: ['PS3', 'XBOX360', 'Wii'], 
                    y: [12.35, 21.50, 30.56] 
                }
            }, 
            {
                label: "Japan",
                data: 
                { 
                    x: ['PS3', 'XBOX360', 'Wii'], 
                    y: [4.58, 1.23, 9.67] 
                }
            }, 
            {
                label: "Other",
                legendEntry: false,
                data: 
                { 
                    x: ['PS3', 'XBOX360', 'Wii'], 
                    y: [31.59, 37.14, 65.32] 
                }
            }],
        });
    });
</script>
This example uses xy for all of the values, with 1st, 3rd, 5th items in the array assigned to x, and 2nd, 4th, 6th items assigned to y.
$("#barchart").wijbarchart({ 
seriesList: [{ 
      label: "Q1", 
      data: { 
                x: [1, 2, 3, 4, 5], 
                y: [12, 21, 9, 29, 30] 
            }
      }, { 
      label: "Q2", 
      data: { 
                // In this case, using xy causes the array
                // to split up so that the 1st, 3rd, 5th, 7th, and 9th
                // values are assigned to x, while the 2nd, 4th,
                // 6th, 8th, and 10th values are assigned to y.
                xy: [1, 21, 2, 10, 3, 19, 4, 31, 5, 20] 
      }}] 
});
This example has a single series, and uses date objects for the x data.
$("#barchart").wijbarchart({ 
seriesList: [{ 
        label: "Q1", 
        data: { 
               x: [new Date(1978, 0, 1), 
                   new Date(1980, 0, 1), 
                   new Date(1981, 0, 1), 
                   new Date(1982, 0, 1), 
                   new Date(1983, 0, 1)], 
               y: [12, 21, 9, 29, 30] 
            }
 }]
Remarks

Each series object in the seriesList array is defined with the following options.

data

An object that contains arrays of X and Y data for the chart series. If you want to change the positioning of the X and Y axes, see the horizontal option.

Type: Object

Default: {}

x

An array of data strings to display along the x axis.

Type: array

Default: []

y

An array of numeric data values to plot along the y axis.

Type: array

Default: []

label

A string value used to label the chart series. By default, this value appears in the legend entry for the series and in the hint when you mouse over a bar in the series. To prevent a series label from appearing in the legend, see legendEntry, below. If you do not provide a label for a series, the label for the series appears as "undefined" in the hint and in the legend.

Type: string

Default: ""

legendEntry

A value that indicates whether to display the label and color of the series in the legend of the chart. Set this value to false to leave a series out of the legend.

Type: Boolean

Default: true

Browser Compatibility
7
5
5

See Also

Reference

options type

 

 


© 2013 All Rights Reserved.

Send comments on this topic.