PDA

View Full Version : columnchart and reload store



wehtam
22 Sep 2009, 7:35 AM
Hello,

I have a little problem with a ColumnChart.
Whem I reload the store, my ColumnChart change very well, but not the yAxis. So when in the fisrt time I have a max value to 10 and the next time I have the max value to 20, my yAxis staying to 10. My yAxis isn't refresh.
Sorry for my very bad english.

My code :


1. var ds_stat_semaine = new Ext.data.JsonStore({
2. url: 'jason_listeStatSemaine.php',
3. root: 'stat',
4. totalProperty: 'totalCount',
5. id: 'date',
6. fields: [ 'date', 'commande' ],
7. autoLoad: true,
8. remoteSort: true,
9. sortInfo: {
10. field: 'date',
11. direction: 'ASC'
12. }
13. });
14.
15. var ds_semaine = new Ext.data.JsonStore({
16. url: 'jason_listeSemaineCommande.php',
17. root: 'semaine',
18. totalProperty: 'totalCount',
19. id: 'Semaine',
20. fields: [ 'Semaine', 'Libelle' ],
21. autoLoad: true,
22. remoteSort: true,
23. sortInfo: {
24. field: 'Semaine',
25. direction: 'ASC'
26. }
27. });
28.
29. var selecteur_semaine = new Ext.form.ComboBox({
30. store: ds_semaine,
31. displayField:'Libelle',
32. valueField: 'Semaine',
33. hiddenName: 'Semaine',
34. typeAhead: true,
35. editable :false,
36. mode: 'remote',
37. triggerAction: 'all',
38. emptyText:'Choisir...',
39. selectOnFocus:true,
40. forceSelection: true,
41. width: 250
42. ,
43. listeners: {
44. select: function(combo, record, index){
45.
46. ds_stat_semaine.load({params:{date:this.getValue()}});
47.
48. }
49. }
50. });
51.
52.
53. // extra extra simple
54. new Ext.Panel({
55. title: 'Nombre de commande par semaine',
56. renderTo: 'div_form',
57. width:720,
58. height:500,
59. layout:'fit',
60.
61. items:
62. [
63. {
64. id : 'statsemaine',
65. xtype: 'columnchart', store: ds_stat_semaine,
66. xField: 'date',
67. yField: 'commande',
68. xAxis: new Ext.chart.CategoryAxis({
69. title: 'Jours'
70. }),
71. yAxis: new Ext.chart.NumericAxis({
72. title: 'Nombre de vente'
73. }),
74. extraStyle: {
75. yAxis: {
76. titleRotation: -90
77. }
78. }
79. }],
80. tbar : [
81. {text:'Choisir la semaine'},selecteur_semaine
82. ]
83. });



Thanks

mrsunshine
22 Sep 2009, 11:14 AM
http://www.extjs.com/forum/showthread.php?t=80907

discuss the same issue