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 Aviram Y, Today, 05:29 AM
    0 responses
    1 view
    0 likes
    Last Post Aviram Y  
    Started by quantismo, 04-17-2024, 05:13 PM
    3 responses
    25 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by ScottWalsh, 04-16-2024, 04:29 PM
    7 responses
    34 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by cls71, Today, 04:45 AM
    0 responses
    6 views
    0 likes
    Last Post cls71
    by cls71
     
    Started by mjairg, 07-20-2023, 11:57 PM
    3 responses
    216 views
    1 like
    Last Post PaulMohn  
    Working...
    X