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 halgo_boulder, Today, 08:44 AM
    0 responses
    1 view
    0 likes
    Last Post halgo_boulder  
    Started by drewski1980, Today, 08:24 AM
    0 responses
    3 views
    0 likes
    Last Post drewski1980  
    Started by rdtdale, Yesterday, 01:02 PM
    2 responses
    17 views
    0 likes
    Last Post rdtdale
    by rdtdale
     
    Started by TradeSaber, Today, 07:18 AM
    0 responses
    7 views
    0 likes
    Last Post TradeSaber  
    Started by PaulMohn, Today, 05:00 AM
    0 responses
    10 views
    0 likes
    Last Post PaulMohn  
    Working...
    X