{"id":4394,"date":"2017-01-07T03:00:46","date_gmt":"2017-01-06T19:00:46","guid":{"rendered":"http:\/\/www.finereport.com\/en\/?p=4394"},"modified":"2018-09-11T17:17:27","modified_gmt":"2018-09-11T09:17:27","slug":"the-methods-of-making-multiple-series-category-chart-sorting-is-available-now","status":"publish","type":"post","link":"https:\/\/www.finereport.com\/en\/product-functions\/the-methods-of-making-multiple-series-category-chart-sorting-is-available-now.html","title":{"rendered":"The Methods of Making Multiple Series (Category) Chart Sorting Are Available Now!"},"content":{"rendered":"<h3><strong>1. Problem description<\/strong><\/h3>\n<p>The figure below shows a table from database in which series under each category are specifically sorted (series summary, i.e. total flow of each series in descending order) for better <a title=\"FineReport data analysis\" href=\"\/en\/help\/data-analysis\" target=\"_blank\">data analysis<\/a> and data under some categories are default.<\/p>\n<p><img src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/010601.jpg\" alt=\"\" \/><\/p>\n<p>Create a dataset data source column chart with the data in the above table for being a better <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> as shown below to see the difference in data sorting between the legend and database in which the sorting of series under each category is the same (default series not applicable to sorting), while the legend order in the chart follows the order of series (port) field read from database. If the name of series under the first category is non-default, the legend order in the chart will be displayed normally (completely displayed by directly reading from the first to the last). If the series data under the first category is default, the legend order will first display series available under such category followed by default series, thus disrupting the original order:<\/p>\n<p><img src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/010602.jpg\" alt=\"\" \/><\/p>\n<p>Now how to keep the legend order in the chart and the order in the database the same in the case of default series?<\/p>\n<h3><strong>2. Solutions<\/strong><\/h3>\n<p>By using cells as chart data source, reorder data in cells, i.e. to form a crosstab with category and series respectively as horizontal and vertical headers, and the default left blank automatically, and reorder series.<\/p>\n<h3><strong>3. Example<\/strong><\/h3>\n<p><strong>3.1 Cell data<\/strong><\/p>\n<p>As shown below, drag data columns to cells to form a crosstab, and calculate the total flow of each category:<\/p>\n<p><img src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/010603.jpg\" alt=\"\" \/><\/p>\n<p><span style=\"color: red;\">Note: it is necessary to manually set C15, i.e. the left father cell of the cell of function sum, to A15<\/span>.<\/p>\n<p>For the method of creating a crosstab, please refer to Crosstab &#8211; Data Horizontal Extension.<\/p>\n<p><strong>3.2 Reorder cells<\/strong><\/p>\n<p>Select the cell of chart series, i.e. A15, and select descending sort by typing the formula of =C15 in <span style=\"color: purple;\">Cell Property Table &#8211; Extension<\/span> Attributes &gt; After Extension, as shown below:<\/p>\n<p><img src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/010604.jpg\" width=750 alt=\"\" \/><\/p>\n<p>Reorder the value expanded by the A15 cell in a way of sorting summarized data in the C15 cell from large to small.<\/p>\n<p><strong>Effect<\/strong><\/p>\n<p>Click Page Break Preview to see the series name in the crosstab is reordered as shown below:<\/p>\n<p><img src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/010605.jpg\" alt=\"\" \/><\/p>\n<p><strong>3.3 Chart data source<\/strong><\/p>\n<p>After the creation of cell data, bind the data with the chart, i.e., re-add chart data source by selecting the chart and selecting Cell Data Source as Data Source in <span style=\"color: purple;\">Chart Attribute Table &#8211; Data<\/span><br \/>\n, as shown below:<\/p>\n<p><img src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/010606.jpg\" alt=\"\" \/><\/p>\n<p><span style=\"color: red;\">Note: if you do not want the cell data to be displayed, then hide them<\/span>.<\/p>\n<p><strong>3.4 Effect viewing<\/strong><\/p>\n<p>Click Page-breaking Preview to see the effect as below:<\/p>\n<p><img src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/010607i.jpg\" alt=\"\" \/><\/p>\n<p>For completed templates, refer to:<span style=\"color: blue;\">%FR_HOME%\\WebReport\\WEB-INF\\reportlets\\doc\\advanced\\chart\\sort.cpt<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Problem description The figure below shows a table from database in which series under each category are specifically sorted (series summary, i.e. total flow of each series in descending order) for better data analysis and data under some categories are default. Create a dataset data source column chart with the data in the above&#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],"yst_prominent_words":[5652,455,580,196,569,5756,586,5574,4734,1151],"_links":{"self":[{"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/posts\/4394"}],"collection":[{"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/comments?post=4394"}],"version-history":[{"count":3,"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/posts\/4394\/revisions"}],"predecessor-version":[{"id":4615,"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/posts\/4394\/revisions\/4615"}],"wp:attachment":[{"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/media?parent=4394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/categories?post=4394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/tags?post=4394"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/yst_prominent_words?post=4394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}