Abstract.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js"><span id='Ext-chart-axis-Abstract'>/**
  19. </span> * @class Ext.chart.axis.Abstract
  20. * Base class for all axis classes.
  21. * @private
  22. */
  23. Ext.define('Ext.chart.axis.Abstract', {
  24. /* Begin Definitions */
  25. requires: ['Ext.chart.Chart'],
  26. /* End Definitions */
  27. <span id='Ext-chart-axis-Abstract-cfg-label'> /**
  28. </span> * @cfg {Ext.chart.Label} label
  29. * The config for chart label.
  30. */
  31. <span id='Ext-chart-axis-Abstract-cfg-fields'> /**
  32. </span> * @cfg {String[]} fields
  33. * The fields of model to bind to this axis.
  34. *
  35. * For example if you have a data set of lap times per car, each having the fields:
  36. * `'carName'`, `'avgSpeed'`, `'maxSpeed'`. Then you might want to show the data on chart
  37. * with `['carName']` on Name axis and `['avgSpeed', 'maxSpeed']` on Speed axis.
  38. */
  39. <span id='Ext-chart-axis-Abstract-method-constructor'> /**
  40. </span> * Creates new Axis.
  41. * @param {Object} config (optional) Config options.
  42. */
  43. constructor: function(config) {
  44. config = config || {};
  45. var me = this,
  46. pos = config.position || 'left';
  47. pos = pos.charAt(0).toUpperCase() + pos.substring(1);
  48. //axisLabel(Top|Bottom|Right|Left)Style
  49. config.label = Ext.apply(config['axisLabel' + pos + 'Style'] || {}, config.label || {});
  50. config.axisTitleStyle = Ext.apply(config['axisTitle' + pos + 'Style'] || {}, config.labelTitle || {});
  51. Ext.apply(me, config);
  52. me.fields = Ext.Array.from(me.fields);
  53. this.callParent();
  54. me.labels = [];
  55. me.getId();
  56. me.labelGroup = me.chart.surface.getGroup(me.axisId + &quot;-labels&quot;);
  57. },
  58. alignment: null,
  59. grid: false,
  60. steps: 10,
  61. x: 0,
  62. y: 0,
  63. minValue: 0,
  64. maxValue: 0,
  65. getId: function() {
  66. return this.axisId || (this.axisId = Ext.id(null, 'ext-axis-'));
  67. },
  68. /*
  69. Called to process a view i.e to make aggregation and filtering over
  70. a store creating a substore to be used to render the axis. Since many axes
  71. may do different things on the data and we want the final result of all these
  72. operations to be rendered we need to call processView on all axes before drawing
  73. them.
  74. */
  75. processView: Ext.emptyFn,
  76. drawAxis: Ext.emptyFn,
  77. addDisplayAndLabels: Ext.emptyFn
  78. });
  79. </pre>
  80. </body>
  81. </html>