Preface: Version Library: Ext JS Library 3.3.1
When creating a chart, many values of the ordinate coordinates are the same. If you accidentally find the following solution, you can test it by yourself and write it for future reference so that others can view it. Other versions have not been tested. If you are interested, you can test it on your own.
Copy codeThe Code is as follows:
Var chartStore; // chart data
Ext. onReady (function (){
// Use the file on the current server. If this sentence is not found, the file will be retrieved from the adobe website by default.
Ext. chart. Chart. CHART_URL = 'extjs/resources/charts.swf ';
Var json_reader = new Ext. data. JsonReader ({
IdProperty: "pointName ",
Root: 'rows ',
TotalProperty: "results ",
Fields :[{
Name: 'pointname'
},{
Name: 'defaultcount ',
Type: "int"
}]
});
// Retrieve data from the background
ChartStore = new Ext. data. Store ({
Proxy: new Ext. data. HttpProxy ({
Url: 'loadcolumnchart. do ',
Method: 'post'
}),
Reader: json_reader
});
ChartStore. reload ();
// Bar chart panel
Var columnchartPanel = new Ext. Panel ({
Border: false,
AutoScroll: true,
// Title: 'device measurement point Fault Record statistics ',
Frame: true,
RenderTo: document. body,
Width: 800,
Height: 240,
Layout: 'fit ',
Items :{
Xtype: 'columnchart', // type
Store: chartStore,
XField: 'pointname', // value of the X axis
YField: 'failcount', // y axis Value
YAxis: new Ext. chart. NumericAxis ({
DisplayName: 'failcount'
// LabelRenderer: Ext. util. Format. numberRenderer ('0, 0') // the key issue is this sentence. It will be normal if I comment this sentence.
}),
TipRenderer: function (chart, record ){
The number of failures for return record. data. pointName + 'is:' +
Ext. util. Format. number (record. data. faultCount, '0, 0 ');
},
Series: [{// Column
Type: 'column ', // The type can be changed (line) line
DisplayName: 'failcount ',
YField: 'failcount ',
Style :{
Color: 0x99BBE8
}
}]
}
});
// Bar chart panel
Var leftPanel = new Ext. Panel ({
Title: 'bar fig ',
Region: 'west ',
Margins: '5 0 0 0 ',
Cmargins: '5 5 0 0 ',
Width: 850,
MinSize: 700,
MaxSize: 850,
AutoScroll: true, // If set to true, a scroll bar is generated when the content overflows. The default value is false.
Collapsible: true, // allowed to contract
Items: columnchartPanel
});
});
1. Before solution:
2. After Resolution: