• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Gradient Chart Background color

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

    Gradient Chart Background color

    Is it possible to to make the chart background a gradient color?
    I have no problem working with HTML code if that is the way to do it.

    #2
    inventor1949, not per default unfortunately, but C# would offer ways to do it (i.e. google LinearGradientBrush).
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks that might work but where do I find the chart code?
      can you point me at the right folder?

      Comment


        #4
        You would need to override the default Plot method to be able to use custom C# graphics, please see for example our CustomPlotSample.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          linear gradient brush

          Bertrand

          How do you get the brush to instantiate?

          The following produces an error.

          LinearGradientBrush myLinearGradientBrush = new LinearGradientBrush();

          Comment


            #6
            Hi Mindset, I suggest you use Intellisense to guide you through the available overloads.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              intellisense vs msdn

              Code:
              // Create a diagonal linear gradient with four stops.   
              LinearGradientBrush myLinearGradientBrush =
                  new LinearGradientBrush();
              myLinearGradientBrush.StartPoint = new Point(0,0);
              myLinearGradientBrush.EndPoint = new Point(1,1);
              myLinearGradientBrush.GradientStops.Add(
                  new GradientStop(Colors.Yellow, 0.0));
              myLinearGradientBrush.GradientStops.Add(
                  new GradientStop(Colors.Red, 0.25));                
              myLinearGradientBrush.GradientStops.Add(
                  new GradientStop(Colors.Blue, 0.75));        
              myLinearGradientBrush.GradientStops.Add(
                  new GradientStop(Colors.LimeGreen, 1.0));
              The above comes straight out of msdn - I see that intellisense is giving me various arguments to complete - so how do lines 1 and 2 compile. Is msdn incorrect??

              Comment


                #8
                Per default you have the Drawing 2D namespace added for using, so you would need work with this instructions then - http://msdn.microsoft.com/en-us/libr...ientbrush.aspx

                It's a different story according to MSDN docs if you were using the one from the Media / Presentation core one...
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  lingradient

                  Aha - didn't know there were 2 types of lingradient brush - thanks for pointing that out.

                  Comment


                    #10
                    Chart Background Using a Gradient Color

                    Hello. Would you happen to have the code to paint the background chart color as a gradient? If not, can you point me to the URL for the CustomPlotSample?

                    My goal is to have the code that paints the chart background as displayed in the attached *.png.

                    Thanks,
                    R. C.
                    Attached Files

                    Comment


                      #11
                      Unfortunately I wouldn't have a complete sample for your task, but the CustomPlot one is default with NT per default as indicator.
                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        Background gradient

                        As my golf was rained off....

                        Edit - see later post (#17) for zip file which is compatible with both 6.5 and 7
                        Attached Files
                        Last edited by Mindset; 09-24-2010, 05:34 AM.

                        Comment


                          #13
                          Hello Mindset,

                          Thank you for the code. I've got one question.

                          I'm currently running NT V6.5.1000.9. When I try to IMPORT BackGroundGradient.zip I receive the following message ..

                          "Import failed. NinjaTrader could not decompress the NinjaScript Archive File: Version required to extract this entry not supported(45)."

                          Have you seen this error before?

                          Comment


                            #14
                            Yes

                            Copy and paste the attached code into a new indicator that you make in 6.5 called BackGroundGradient and see if it will compile.
                            Attached Files

                            Comment


                              #15
                              I'm getting a compile error on the following lines :

                              [GridCategory("Text & Colors")]

                              The type or namespace name 'GridCategory' could not be found (are you missing a using directive or an assembly reference?) Code : CS0246

                              Do you have an additional DLL that contains the GridCategory reference?

                              P.S. When I comment out the "GridCategory" lines, everything works great.

                              Thanks again.
                              Last edited by rcsingleton; 09-23-2010, 05:37 PM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by 7robert, Today, 12:23 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post 7robert
                              by 7robert
                               
                              Started by autogenix, Today, 11:23 AM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_Jim  
                              Started by pstrusi, Today, 11:34 AM
                              1 response
                              10 views
                              0 likes
                              Last Post NinjaTrader_Kate  
                              Started by autogenix, Today, 11:19 AM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_Spencer  
                              Started by martyn73, Yesterday, 04:31 PM
                              3 responses
                              19 views
                              0 likes
                              Last Post NinjaTrader_ChristopherJ  
                              Working...
                              X