Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problems with programmatic setting of ChartScale

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Problems with programmatic setting of ChartScale

    I am seeing two issues when setting the chart scale programmatically:

    1. If I change the type of the scale from automatic to fixed like this
    Code:
    if (chartScale.Properties.YAxisRangeType == YAxisRangeType.Automatic)
    {          
        chartScale.Properties.FixedScaleMax = chartScale.MaxValue;
        chartScale.Properties.FixedScaleMin = chartScale.MinValue;
        chartScale.Properties.YAxisRangeType = YAxisRangeType.Fixed;
    }
    the scale does correctly change, but the "F" button is not displayed within the scale. If I then close/save/restart, the chart comes up with the correct scale and the "F" is showing.

    2. I have also tried to slide the fixed scale (similar to how it slides with a CTL-click in the scale. I do this by setting the FixedScaleMin/Max with offset values from mouse move events. This kind of works, but it is very jittery like one of the Min/Max sets is fighting the other one or there is some kind of rounding going on. How can this be accomplished in a smooth fashion? It seems like there needs to be a method to set both the Min/Max concurrently.

    #2
    Hello aslane,

    Changing chartScale properties is not documented in the help guide and is not supported by NinjaTrader Support to do.

    This thread will remain open for any community members who would like to assist.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      If the properties have setters, then you should be able to change them.

      The first case I listed is clearly a bug.

      The second case is an omission in the interface.

      Comment


        #4
        There is no guarantee these GUI related properties can be modified:

        ChartControl.Properties
        ChartBars.Properties
        ChartScale.Properties

        There are sometimes NS interfaces to update these values (e.g, BackBrushes, DrawHorizontalGridLnes, etc) - although not all real-world use cases have been identified so there may not be a way to control everything you wish. These setters are exposed for application GUI reasons, but in principle these properties were exposed for NS developers as an interface to read the environment their indicators are running.

        If there is something you are trying to do related to these properties, please let us know and we can process as a possible enhancement once the use case has been justified.

        For your specific use case, you can use the OnCalculateMinMax() to set the min/max values:



        Although there is not a way to set the fix scale as this property is defined by user control. If you can detail why you would need to use a Fixed scale specifically, we can review that with development.
        MatthewNinjaTrader Product Management

        Comment


          #5
          Originally posted by NinjaTrader_Matthew View Post
          For your specific use case, you can use the OnCalculateMinMax() to set the min/max values
          Clearly, I can not use this as I am trying to use Fixed Scale.

          I am fine if you want to add routines to switch modes / set the min/max values.

          I am trying to interactively move/scroll/scale the x/y axis based on user input (other than the user manually changing the scale). I can not say much more than that.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          65 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          41 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          23 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          26 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          52 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X