Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Chart Grid Height

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

    Chart Grid Height

    I have added a menu at the top of the chart but I can't change the ChartGrid row Height.

    Here is part of my code

    Code:
    chartGrid.RowDefinitions.Add(new System.Windows.Controls.RowDefinition());
    				chartGrid.RowDefinitions.Add(new System.Windows.Controls.RowDefinition());
    
    				if (chartGrid.RowDefinitions.Count == 2)
    				{
    					chartGrid.RowDefinitions.Add(new System.Windows.Controls.RowDefinition());
    					addedFirstRow = true;
    				}
    		
    				// shift existing row sizes 2 down
    				for (int i = chartGrid.RowDefinitions.Count - 1; i > 1; i--)
    					chartGrid.RowDefinitions[i].Height = chartGrid.RowDefinitions[i - 2].Height;
    
    				chartGrid.RowDefinitions[0].Height = new GridLength(28);
    				// spacing row
    				chartGrid.RowDefinitions[1].Height = new GridLength(3);
    If I change the new GridLength(28) to anything bigger I cannot icrease the row height at the top of the chart.

    Any idea ?

    Thanks

    #2
    Hello blar58,

    Thanks for opening the thread.

    Custom WPF modifications aren't an item that we would provide support for, however there are some pre-written examples that you may wish to reference in order to accomplish your goal.

    Chelsea has some posted some examples that we worked on here: https://ninjatrader.com/support/foru...327#post499327

    ChartCustomToolBarExample and InsertWPFControls() at line 315 should provide you enough direction to for this task. I did not have issue creating rows/columns as big as I needed.

    I suggest taking a similar approach to inserting additional rows/columns that you may need and to specify the width/height that you require. The script essentially works as follows: CreateWPFControls() is called in State.DataLoaded or State.Historical and creates the necessary controls you wish to add. InsertWPFControls() is then called to create space for the controls on the chart grid, and then to place the controls into the newly created space. DisposeWPFControls() is then called on State.Terminated.

    There are certain implications to consider when adding multiple instances of scripts that modify the chart grid as well as creating new tabs. We will typically direct you to these examples for known working implementations.

    Please let us know if you have any additional questions.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Barry Milan, Yesterday, 10:35 PM
    5 responses
    17 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by DanielSanMartin, Yesterday, 02:37 PM
    2 responses
    13 views
    0 likes
    Last Post DanielSanMartin  
    Started by DJ888, 04-16-2024, 06:09 PM
    4 responses
    13 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by terofs, Today, 04:18 PM
    0 responses
    12 views
    0 likes
    Last Post terofs
    by terofs
     
    Started by nandhumca, Today, 03:41 PM
    0 responses
    8 views
    0 likes
    Last Post nandhumca  
    Working...
    X