X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/docs/api/Ext.chart.Legend.html diff --git a/docs/api/Ext.chart.Legend.html b/docs/api/Ext.chart.Legend.html new file mode 100644 index 00000000..ddde0928 --- /dev/null +++ b/docs/api/Ext.chart.Legend.html @@ -0,0 +1,149 @@ +Ext.chart.Legend | Ext JS 4.0 Documentation +
For up to date documentation and features, visit +http://docs.sencha.com/ext-js/4-0

Sencha Documentation

+ + + + + +

Defines a legend for a chart's series. +The 'chart' member must be set prior to rendering. +The legend class displays a list of legend items each of them related with a +series being rendered. In order to render the legend item of the proper series +the series configuration object must have showInSeries set to true.

+ +

The legend configuration object accepts a position as parameter. +The position parameter can be left, right +top or bottom. For example:

+ +
legend: {
+    position: 'right'
+},
+
+ +

Full example:

+ +
    var store = Ext.create('Ext.data.JsonStore', {
+        fields: ['name', 'data1', 'data2', 'data3', 'data4', 'data5'],
+        data: [
+            {'name':'metric one', 'data1':10, 'data2':12, 'data3':14, 'data4':8, 'data5':13},
+            {'name':'metric two', 'data1':7, 'data2':8, 'data3':16, 'data4':10, 'data5':3},
+            {'name':'metric three', 'data1':5, 'data2':2, 'data3':14, 'data4':12, 'data5':7},
+            {'name':'metric four', 'data1':2, 'data2':14, 'data3':6, 'data4':1, 'data5':23},
+            {'name':'metric five', 'data1':27, 'data2':38, 'data3':36, 'data4':13, 'data5':33}                                                
+        ]
+    });
+    
+    Ext.create('Ext.chart.Chart', {
+        renderTo: Ext.getBody(),
+        width: 500,
+        height: 300,
+        animate: true,
+        store: store,
+        shadow: true,
+        theme: 'Category1',
+        legend: {
+            position: 'top'
+        },
+         axes: [{
+                type: 'Numeric',
+                grid: true,
+                position: 'left',
+                fields: ['data1', 'data2', 'data3', 'data4', 'data5'],
+                title: 'Sample Values',
+                grid: {
+                    odd: {
+                        opacity: 1,
+                        fill: '#ddd',
+                        stroke: '#bbb',
+                        'stroke-width': 1
+                    }
+                },
+                minimum: 0,
+                adjustMinimumByMajorUnit: 0
+            }, {
+                type: 'Category',
+                position: 'bottom',
+                fields: ['name'],
+                title: 'Sample Metrics',
+                grid: true,
+                label: {
+                    rotate: {
+                        degrees: 315
+                    }
+                }
+        }],
+        series: [{
+            type: 'area',
+            highlight: false,
+            axis: 'left',
+            xField: 'name',
+            yField: ['data1', 'data2', 'data3', 'data4', 'data5'],
+            style: {
+                opacity: 0.93
+            }
+        }]
+    });    
+    
+ +
Defined By

Config Options

Other Configs

 

Fill style for the legend box

+

Fill style for the legend box

+
 

Style of the stroke for the legend box

+

Style of the stroke for the legend box

+
 

Width of the stroke for the legend box

+

Width of the stroke for the legend box

+
 

Sets the z-index for the legend. Defaults to 100.

+

Sets the z-index for the legend. Defaults to 100.

+
 

Amount of space between legend items

+

Amount of space between legend items

+
 

Font to be used for the legend labels, eg '12px Helvetica'

+

Font to be used for the legend labels, eg '12px Helvetica'

+
 

Amount of padding between the legend box's border and its items

+

Amount of padding between the legend box's border and its items

+
 
The position of the legend in relation to the chart. One of: "top", +"bottom", "left", "right", or "float". If set to ...

The position of the legend in relation to the chart. One of: "top", +"bottom", "left", "right", or "float". If set to "float", then the legend +box will be positioned at the point denoted by the x and y parameters.

+
 

Whether or not the legend should be displayed.

+

Whether or not the legend should be displayed.

+
 

X-position of the legend box. Used directly if position is set to "float", otherwise +it will be calculated dynamically.

+

X-position of the legend box. Used directly if position is set to "float", otherwise +it will be calculated dynamically.

+
 

Y-position of the legend box. Used directly if position is set to "float", otherwise +it will be calculated dynamically.

+

Y-position of the legend box. Used directly if position is set to "float", otherwise +it will be calculated dynamically.

+
Defined By

Properties

 

Whether the legend box is oriented vertically, i.e. if it is on the left or right side or floating.

+

Whether the legend box is oriented vertically, i.e. if it is on the left or right side or floating.

+
Defined By

Methods

 

 

+

Returns

  • void    +
\ No newline at end of file