Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
X-axis sorting in chart
jain
Hi, I have created the bar chart with period(datatype: String) in x-axis. The bar chart is displaying as below, could anyone please let me know in what way I can sort it? I have attached the report design file for your reference.
Actual result Expected result
1 year 1 year
10 year 3 year
3 year 5 year
5 year 7 year
7 year 10 year
Since Since
Thanks,
Jain
Find more posts tagged with
Comments
kclark
Take a look at the report I've modified for you. I added another field to the scripted data set to give an order field. In the chart I used it to sort the axis. I used this script to create the order<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>switch(row["Month"]){
case "1 year": temp = 1;
break;
case "3 year": temp = 2;
break;
case "5 year": temp = 3;
break;
case "7 year": temp = 4;
break;
case "10 year": temp = 5;
break;
default: temp = 6;
}
row["Order"] = temp;</pre>
jain
Hi Kclark, I have used the solution in my report which you have provided, its working as expected. Thanks a lot