Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 - how to access complete ChartWindow background?

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

    NT8 - how to access complete ChartWindow background?

    Hi there,

    I have two questions regarding backgound brushes :

    1. In the new UI we can set the Chart Background as 'GradientBrush'. I understand this is a beta version of NT8, but how is it possible to add my own linear gradient brush? I know how to make a Lgb but do not know how to access the entire panels backgrounds.

    2. How do I programmatically access the entire canvas or ChartWindow to render a Lgb? I used to use ChartControl in NT7. I modified the 'Sample Custom Plot' but cannot plot over the entire chart, just the selected panel. Please see image.

    Thank you,

    Simon.
    Attached Files

    #2
    Hello,

    To change the background colors on charts, take a look at BackBrushAll and BackBrushesAll in the language reference section of the help guide.

    In terms of plotting or drawing across all Panels, that is currently not possible in the NinjaScript framework. Custom drawing on charts is done using SharpDX drawing methods in NinjaTrader 8, which rely on pixel coordinates of an entire chart to place drawn objects. However, we have custom clipping logic in place to ensure that a SharpDX draw object cannot be located outside the bounds of the panel on which the associated script resides.
    Dave I.NinjaTrader Product Management

    Comment


      #3
      I hear you, thank you.

      You basically answered my second question but not my first one. Please see the image attached below. This was done programmatically in NT7 via ChartControl.ChartPanel.Paint. Notice it is over the entire chart window.

      However, can this be done within the Chart properties UI under "Chart background". I noticed NT8 already has a gray based Gradient Brush available to use, but can I "import"my own gradient brush/ image brush and allow it to show in the UI?

      Thanks again.
      Attached Files

      Comment


        #4
        That is actually easier than you may expect. In the xaml file for the Skin that you are using, you should find a list of defined brushes to be included in color-picker lists, near the bottom of the file, within the block <collections:ArrayList x:Key="customColorPickerList">.

        You should be able to add a LinearGradientBrush via xaml within that block, and then select the brush via any color picker list throughout NinjaTrader 8. You should be able to use this process for any supported brush type.
        Dave I.NinjaTrader Product Management

        Comment


          #5
          Thank you Dave :-)

          Comment


            #6
            Please see below for how I used this info to get a custom color. I do have one question???? When I completed the steps outlined below I now have two gradient brushes to choose from. The original and my new one. That is great but my question is...Can you update the code so that the new custom color has it's own name instead of just "gradient brush"? Thank you.

            I have used this information to get around the fact that RGB colors are currently not available as background colors. Thanks to all contributors to this thread for helping. Here is what I did and there may be an easier way. I first copied, pasted and renamed a skin folder to try this on. I used the website http://www.cssmatic.com/ to help get the hex color equivalent of the RGB color I used in NT7. I believe hex is the correct name. It was in the form #8f6849. I then updated the blueprint.xaml file using notepad to add the custom color at the very bottom of the text within the blueprint.xaml file. Code below:
            Code:
            <collections:ArrayList x:Key="customColorPickerList">
            		<LinearGradientBrush StartPoint="0.5, -0.05"
            							 EndPoint="0.5, 0.66"
            							 po:Freeze="true">
            			<LinearGradientBrush.GradientStops>
            				<GradientStop Color="{StaticResource ButtonBackgroundStop1}"
            							  Offset="0" />
            				<GradientStop Color="{StaticResource ButtonBackgroundStop2}"
            							  Offset="1" />
            			</LinearGradientBrush.GradientStops>
            		</LinearGradientBrush>
            <LinearGradientBrush StartPoint="0.5, -0.05"
            							 EndPoint="0.5, 0.66"
            							 po:Freeze="true">
            			<LinearGradientBrush.GradientStops>
            				[B]<GradientStop [B]Color="#8f6849"[/B][/B]
            							  Offset="0" />
            				[B]<GradientStop [B]Color="#8f6849"[/B][/B]
            							  Offset="1" />
            			</LinearGradientBrush.GradientStops>
            		</LinearGradientBrush>
            
            	</collections:ArrayList>
            You will notice that I used the desired color in both places for the Color= section. When I use the skin that this blueprint.xaml is saved in I can now select this color in the dropdown color picker.
            Last edited by jhowinvest; 12-23-2015, 03:50 PM.

            Comment


              #7
              Tried this and this seems better for a solid color....

              Need this line up at the very top of the blueprint.xaml file. Original Slate Gray skin has it but others don't. This line is required to allow you to name the color as it will show up in the color picker list using the wpgDisplayHelper.Display="YourColorNameHere" below.
              Code:
              xmlns:wpg="clr-namespace:System.Windows.Controls.WpfPropertyGrid;assembly=System.Windows.Controls.WpfPropertyGrid"
              Used this line in the customColorPickerList section at the very bottom of the blueprint.xaml
              Code:
              <SolidColorBrush	Color="#8f6849" 	po:Freeze="true" wpg:DisplayHelper.Display="Coffee"/>
              Attached Files
              Last edited by jhowinvest; 12-23-2015, 08:45 PM.

              Comment


                #8
                Thank you 'jhowinvest' for trying this out. I for one had wanted to know 'IF' it were possible, then put it on the 'back-burner' for a later date. But I'm so glad you replied with your findings. All your hard work will help me and others speed up the process for ourselves!

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Skifree, Today, 03:41 AM
                1 response
                4 views
                0 likes
                Last Post Skifree
                by Skifree
                 
                Started by usazencort, Today, 01:16 AM
                0 responses
                1 view
                0 likes
                Last Post usazencort  
                Started by kaywai, 09-01-2023, 08:44 PM
                5 responses
                603 views
                0 likes
                Last Post NinjaTrader_Jason  
                Started by xiinteractive, 04-09-2024, 08:08 AM
                6 responses
                23 views
                0 likes
                Last Post xiinteractive  
                Started by Pattontje, Yesterday, 02:10 PM
                2 responses
                23 views
                0 likes
                Last Post Pattontje  
                Working...
                X