1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-chart.axis.Category'>/**
2 </span> * @class Ext.chart.axis.Category
3 * @extends Ext.chart.axis.Axis
5 * A type of axis that displays items in categories. This axis is generally used to
6 * display categorical information like names of items, month names, quarters, etc.
7 * but no quantitative values. For that other type of information <em>Number</em>
8 * axis are more suitable.
10 * As with other axis you can set the position of the axis and its title. For example:
12 * {@img Ext.chart.axis.Category/Ext.chart.axis.Category.png Ext.chart.axis.Category chart axis}
14 * var store = Ext.create('Ext.data.JsonStore', {
15 * fields: ['name', 'data1', 'data2', 'data3', 'data4', 'data5'],
17 * {'name':'metric one', 'data1':10, 'data2':12, 'data3':14, 'data4':8, 'data5':13},
18 * {'name':'metric two', 'data1':7, 'data2':8, 'data3':16, 'data4':10, 'data5':3},
19 * {'name':'metric three', 'data1':5, 'data2':2, 'data3':14, 'data4':12, 'data5':7},
20 * {'name':'metric four', 'data1':2, 'data2':14, 'data3':6, 'data4':1, 'data5':23},
21 * {'name':'metric five', 'data1':27, 'data2':38, 'data3':36, 'data4':13, 'data5':33}
25 * Ext.create('Ext.chart.Chart', {
26 * renderTo: Ext.getBody(),
34 * fields: ['data1', 'data2', 'data3', 'data4', 'data5'],
35 * title: 'Sample Values',
45 * adjustMinimumByMajorUnit: 0
50 * title: 'Sample Metrics',
63 * yField: ['data1', 'data2', 'data3', 'data4', 'data5'],
70 * In this example with set the category axis to the bottom of the surface, bound the axis to
71 * the <em>name</em> property and set as title <em>Month of the Year</em>.
74 Ext.define('Ext.chart.axis.Category', {
76 /* Begin Definitions */
78 extend: 'Ext.chart.axis.Axis',
80 alternateClassName: 'Ext.chart.CategoryAxis',
82 alias: 'axis.category',
86 <span id='Ext-chart.axis.Category-property-categoryNames'> /**
87 </span> * A list of category names to display along this axis.
89 * @property categoryNames
94 <span id='Ext-chart.axis.Category-property-calculateCategoryCount'> /**
95 </span> * Indicates whether or not to calculate the number of categories (ticks and
96 * labels) when there is not enough room to display all labels on the axis.
97 * If set to true, the axis will determine the number of categories to plot.
98 * If not, all categories will be plotted.
100 * @property calculateCategoryCount
103 calculateCategoryCount: false,
105 // @private creates an array of labels to be used when rendering.
106 setLabels: function() {
107 var store = this.chart.store,
108 fields = this.fields,
113 store.each(function(record) {
114 for (i = 0; i < ln; i++) {
115 this.labels.push(record.get(fields[i]));
120 // @private calculates labels positions and marker positions for rendering.
121 applyData: function() {
124 var count = this.chart.store.getCount();
134 </pre></pre></body></html>