Problem in color of FastLine and Arrow series in V3

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
MeirS
Newbie
Newbie
Posts: 14
Joined: Thu Jan 25, 2007 12:00 am

Problem in color of FastLine and Arrow series in V3

Post by MeirS » Wed Aug 15, 2007 12:05 pm

Hi,

I have a WebChart with data that I want to represent in a FastLine (or Line) series and in an Arrow series
I want both series to be the same color,
But FastLine (or Line) and Arrow series with the same value for the Color property are displayed in different colors in the webchart
(In the legend their colors are the same)
(We use version 3.2.2763.26082)

Here is my code sample:

Code: Select all

       protected void Page_Load(object sender, System.EventArgs e)
        {
          Steema.TeeChart.Chart ch1 = WebChart1.Chart; 

          if (Session["ch1"] == null) 
          { 
             //setup Chart 
             ch1.Aspect.View3D = false;

             Steema.TeeChart.Styles.FastLine line1 = new Steema.TeeChart.Styles.FastLine(ch1); 
             line1.FillSampleValues(100);
             line1.Color = Color.FromArgb(255, 236,0,140) ;

             Steema.TeeChart.Styles.Arrow arrow = new Arrow(ch1);
             arrow.FillSampleValues(2);
             arrow.Color = Color.FromArgb(255, 236, 0, 140);
             ExportChart(ch1); 
          } 
          else 
          { 
             MemoryStream tmpChart = new MemoryStream(); 

             //retrieve the session stored Chart 
             tmpChart = (MemoryStream)Session["ch1"]; 
             //set the Stream position to 0 as the last read/write 
             //will have moved the position to the end of the stream 
             tmpChart.Position = 0; 
             //import saved Chart 
             ch1.Import.Template.Load(tmpChart);

          } 
        } 

   private void ExportChart(Steema.TeeChart.Chart ch1) 
   { 
      MemoryStream tmpChart = new MemoryStream(); 

      //export Chart to a MemoryStream template 
      ch1.Export.Template.Save(tmpChart); 
      //save template to a Session variable 
      Session.Add("ch1", tmpChart); 
   } 

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Aug 16, 2007 11:40 am

Hi MeirS,

Yes, this is an arrow series issue. TeeChart for .NET darkens series pen to make them look better but in this case, as it's in 2D and only the arrow pen is visible, it is the darkened color what's visible.

We have already fixed this issue for the next v3 maintenance release. In the meantime, a workaround would be increasing arrow's color a 40 percent that later will be decreased. However this may not work in some cases when the desired color plus a 40 percent exceeds 255.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply