Sisense Community logo
    • Community Feedback
    • Chapters
    • Events
    • Forums
      • Help and How To
      • Product Feedback Forum
      • Strategy & Use Cases
    • Blogs
    • KB Docs
      • KB Docs
      • Add-Ons & Plug-Ins
      • APIs
      • Best Practices
      • Blox
      • CDT
      • Cloud Managed Service
      • Data Models
      • Data Sources
      • Embedding Analytics
      • How-Tos & FAQs
      • Onboarding
      • PySisense
      • Security
      • Sisense Administration
      • Sisense Intelligence & AI
      • Troubleshooting
      • Widget & Dashboard Scripts
    • Support
    • Learning
      • Sisense Academy: Free Courses and Certifications
      • Official Developer Documentation
      • Official Product Documentation
      • Official Sisense Youtube Channel
      • Sisense Compose SDK Playground
    • Use Case Gallery
    All PostsDiscussionsBlogsIdeasQuestions
    Leaderboards
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
    Discussions
    • Knowledge Base DocsChevronRightIcon
    • How-Tos & FAQsChevronRightIcon
    Limit the max value of the y-axis in the column chart to the max value [Linux]

    Step-by-Step Guide: 

    If you created a Column chart usually you will see such a result

    Bar chart showing uniform distribution across age ranges 0-18 to 65+, each with a value of 1. The bars are light purple, indicating unique age range count.

     

    The Y-axis is usually a little bit higher than the actual value.

    To improve this, press edit for the widget.

    Set the interval to 1

     

    Press 3 dots, choose Edit Script.

    In the new window, paste the following JavaScript code:

    widget.on('beforeviewloaded', (scope,args)=>{
    	console.log(args);
    	//args.options.yAxis[0].max = 1;
    	args.options.yAxis[0].endOnTick = false;
    	
    })
    

    Press the Save button to save the script.

    Refresh the dashboard.

     

    Bar chart showing uniform distribution across age ranges: 0-18, 19-24, 25-34, 35-44, 45-54, 55-64, and 65+. Each bar represents the number 1.

     

    Now we can see that the values have the maximum value on the Y-axis.

    Conclusion: 

    It is one of the ways to set the maximum value for the values on the Y-axis.

    Disclaimer: This post outlines a potential custom workaround for a specific use case or provides instructions regarding a specific task. The solution may not work in all scenarios or Sisense versions, so we strongly recommend testing it in your environment before deployment. If you need further assistance with this, please let us know.

    OleksandrB
    By
    OleksandrB
    Posted 11 months ago
                                           
             
    0 comments

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
                   
                                                                                     
    •                                                              
    •                                                              
    •