{"id":4354,"date":"2017-01-05T03:00:08","date_gmt":"2017-01-04T19:00:08","guid":{"rendered":"http:\/\/www.finereport.com\/en\/?p=4354"},"modified":"2018-09-11T17:18:25","modified_gmt":"2018-09-11T09:18:25","slug":"do-you-know-the-magic-of-single-series-category-chart-sorting-how-to-make-it","status":"publish","type":"post","link":"https:\/\/frg.fineres.com\/en\/2017\/01\/05\/do-you-know-the-magic-of-single-series-category-chart-sorting-how-to-make-it\/","title":{"rendered":"Do You Know the Magic of Single Series (Category) Chart Sorting? How to Make it?"},"content":{"rendered":"<h3>1. Problem description<\/h3>\n<p>In using a chart, it is able to display by data size. Take a column chart as an example, how to allow all columns to be sorted by data size from high to low or vice versa for better <a title=\"FineReport data analysis\" href=\"\/en\/help\/data-analysis\" target=\"_blank\">data analysis<\/a>, as shown below?<br \/>\n<img src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/0104001.jpg\" alt=\"\" \/><\/p>\n<h3>2. Realization ideas<\/h3>\n<p>The chart, a good <a title=\"FineReport BI and reporting tool\" href=\"\/en\/\" target=\"_blank\">reporting tool<\/a> and <a title=\"FineReport reporting and business intelligence tool\" href=\"\/en\/\" target=\"_blank\">business intelligence tool<\/a>, is sorted and displayed based on series by default.<br \/>\nIf the chart data source comes from a single dataset, it is possible to sort directly using <span style=\"color: blue;\">Sort In The Data Set<\/span>, and set the chart data source as dataset data; if the chart data source is calculated by cell, it is possible to sort by using <span style=\"color: blue;\">Sort After Extension<\/span> and set the chart data source as cell data.<\/p>\n<h3>3. Example<\/h3>\n<p>Here is a simple example to show how to realize the effect as shown above so as to achieve <a title=\"FineReport BI and reporting tool data visualization\" href=\"\/en\/help\/data-visualization\" target=\"_blank\">data visualization<\/a>.<\/p>\n<p><strong>3.1 Dataset data as chart data source<\/strong><\/p>\n<p><strong>3.1.1 Open template<\/strong><br \/>\nOpen template:<span style=\"color: blue;\">%FR_HOME%\\WebReport\\WEB-INF\\reportlets\\doc\\Advanced\\Chart\\Logchart.cpt<\/span>\u3002<\/p>\n<p><strong>3.1.2 Change data set<\/strong><br \/>\nChange the original data set to descending sort by cost price, with SQL statement of <span style=\"color: purple;\">SELECT * FROM [product] where category ID= 1order by cost price desc<\/span><\/p>\n<p><strong>3.1.3 View effect<\/strong><br \/>\nView the effect in which columns are sorted descending from high to low by clicking Page Break Preview as shown above.<\/p>\n<p><strong>3.2 Cell data as chart data source<\/strong><\/p>\n<p><strong>3.2.1 Open template<\/strong><br \/>\nOpen template:<span style=\"color: blue;\">%FR_HOME%\\WebReport\\WEB-INF\\reportlets\\doc\\Advanced\\Chart\\Logchart.cpt<\/span>\u3002<\/p>\n<p><strong>3.2.1 Change template<\/strong><br \/>\nDrag corresponding data columns to the cell as shown below.<br \/>\n<img src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/0104002.jpg\" alt=\"\" \/><br \/>\n<strong>3.2.3 Set sorting<\/strong><br \/>\nRight click the cell of A2 to select Extension Attributes, set the sorting after extension to Descending in the Cell Attribute panel, and type B2 in the formula.<br \/>\n<img src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/0104003.jpg\" alt=\"\" \/><br \/>\n<strong>3.2.4 Set dataset<\/strong><br \/>\nSet dataset as shown below:<br \/>\n<img src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/0104004.jpg\" alt=\"\" \/><br \/>\n<strong>3.2.5 Hide cells<\/strong><br \/>\nHide the data in cells by selecting the first and second lines and right clicking to select Hide Lines.<\/p>\n<p><strong>3.2.6 View effect<\/strong><br \/>\nView the effect in which columns are sorted descending from high to low by clicking Page Break Preview as shown above.<br \/>\n<span style=\"color: red;\">Note: Bar charts and pie charts are set in the same way<\/span>.<\/p>\n<p><strong>3.3 Template saving<\/strong><br \/>\nChart sorting template of dataset data source is saved in:<span style=\"color: blue;\">%FR_HOME%\\WebReport\\WEB-INF\\reportlets\\doc\\Advanced\\Chart\\Logchart_3.cpt<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Problem description In using a chart, it is able to &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[111],"tags":[126,117],"_links":{"self":[{"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/posts\/4354"}],"collection":[{"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/comments?post=4354"}],"version-history":[{"count":2,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/posts\/4354\/revisions"}],"predecessor-version":[{"id":4368,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/posts\/4354\/revisions\/4368"}],"wp:attachment":[{"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/media?parent=4354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/categories?post=4354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/tags?post=4354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}