This will require Builder privileges for setup and implementation.
Issue:
Terms are sorted alphabetically based on the X-Axis. We need to correct this...
Ok, so maybe it is not randomly, but it is not how we want it.
Resolution:
On the Axis List tab of the Chart Designer:
- Add an axis with the (+) button
- Choose (Expression) in the Data Column
- Name the Axis (it doesn’t matter what)
- Click the Hide check box.
- In Define an Expression for the Selected Axis, enter the following JavaScript expression:
var x = x
if ( x == 'Sunday' ) { 1 }
else if ( x == 'Monday' ) { 2 }
else if ( x == 'Tuesday' ) { 3 }
else if ( x == 'Wednesday' ) { 4 }
else if ( x == 'Thursday' ) { 5 }
else if ( x == 'Friday' ) { 6 }
else if ( x == 'Saturday' ) { 7 }
else {'ERROR'}
- In the Data Type drop-down choose Number
The result of this expression:
var x = x
if ( x == 'Sunday' ) { 1 }
else if ( x == 'Monday' ) { 2 }
else if ( x == 'Tuesday' ) { 3 }
else if ( x == 'Wednesday' ) { 4 }
else if ( x == 'Thursday' ) { 5 }
else if ( x == 'Friday' ) { 6 }
else if ( x == 'Saturday' ) { 7 }
else {'ERROR'}
As you can see, in Chart Properties we have replaced Days of the Week with Numbers which will allow us to sort our data effectively.
Once you Save, the chart will be sorted correctly.
The following settings may need to be applied:
- In Basic Settings go to Match Type
- This should be set to: X-values
- Adding a Sort On value sometimes helps to correct the sorting issue as well as:
- Toggling Sort Order from Ascending to Descending and then back.
For More Information:
- iDashboards Builder Manual 14 Analytics
- JavaScript Expression Help
- JavaScript: Derived Columns
Disclaimer: iDashboards Technical Support Engineers are not Data Analysts who know in depth SQL Queries or JavaScript Expressions. We often learn these skills on the job and have limited knowledge. We do our best to help you with your software in determining if: you are not leveraging the software in the best way for your data or you found a bug in the software, because we want to assist you in your success. If you have issues with in depth queries or expressions please contact iDashboards Support and know that it will take a bit of time to figure out what is necessary for this issue, and if necessary we will refer you to your Client Success Manager to schedule time with a Principal Product Engineer.
If the above is unable to resolve the issue, then please contact iDashboards Support for further assistance.
Comments
0 comments
Please sign in to leave a comment.