Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    637 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    366 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    107 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    569 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    571 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X