Solution to the repeated ExtJs ordinate values

Source: Internet
Author: User

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:
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.