colour of dots in point series is not working
Posted: Mon Aug 28, 2006 11:22 pm
Hi,
After ugrading from teechart lite to pro, assigning colours to individual points in a points series when you add a point only seems to work randomly.
Here is the code:
[code]
Points origin = new Points();
origin.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
int catchRadius = 5;
origin.Pointer.HorizSize = catchRadius;
origin.Pointer.VertSize = catchRadius;
int dotColour = (int)Math.Round((double)maxCatchColour * ((double)ca.Kg /maxKg),0);
Color col = new Color();
if(dotColour < 20)
col = Color.FromArgb(227,255,94);
else if (dotColour < 40)
col = Color.FromArgb(174,193,84);
else if (dotColour < 60)
col = Color.FromArgb(84,97,23);
else if (dotColour < 80)
col = Color.FromArgb(255,47,47);
else if (dotColour <= 100)
col = Color.FromArgb(172,45,45);
origin.Add(x,y,ca.SpeciesName,col);
origin.Cursor = Cursors.Hand;
[/code]
When there are more than three points some of the points don't pick up the colour set when adding the point (they keep the series colour).
Can any one tell me how to set the colours?
Here is are the chart properties incase they help:
[code]
//
// tchLocationsGraph
//
//
// tchLocationsGraph.Aspect
//
this.tchLocationsGraph.Aspect.View3D = false;
//
// tchLocationsGraph.Axes
//
//
// tchLocationsGraph.Axes.Bottom
//
this.tchLocationsGraph.Axes.Bottom.Automatic = false;
this.tchLocationsGraph.Axes.Bottom.AutomaticMaximum = false;
this.tchLocationsGraph.Axes.Bottom.AutomaticMinimum = false;
this.tchLocationsGraph.Axes.Bottom.Increment = 1;
this.tchLocationsGraph.Axes.Bottom.Maximum = 880;
this.tchLocationsGraph.Axes.Bottom.Minimum = 0;
this.tchLocationsGraph.Axes.Bottom.Visible = false;
this.tchLocationsGraph.Axes.DrawBehind = false;
//
// tchLocationsGraph.Axes.Left
//
this.tchLocationsGraph.Axes.Left.Automatic = false;
this.tchLocationsGraph.Axes.Left.AutomaticMaximum = false;
this.tchLocationsGraph.Axes.Left.AutomaticMinimum = false;
this.tchLocationsGraph.Axes.Left.Increment = 1;
//
// tchLocationsGraph.Axes.Left.Labels
//
this.tchLocationsGraph.Axes.Left.Labels.Style = Steema.TeeChart.AxisLabelStyle.None;
this.tchLocationsGraph.Axes.Left.Labels.Visible = false;
this.tchLocationsGraph.Axes.Left.Maximum = 0;
this.tchLocationsGraph.Axes.Left.Minimum = -623;
//
// tchLocationsGraph.Axes.Left.Title
//
this.tchLocationsGraph.Axes.Left.Title.Visible = false;
this.tchLocationsGraph.Axes.Left.Visible = false;
//
// tchLocationsGraph.Axes.Right
//
this.tchLocationsGraph.Axes.Right.Visible = false;
//
// tchLocationsGraph.Axes.Top
//
this.tchLocationsGraph.Axes.Top.Visible = false;
this.tchLocationsGraph.Axes.Visible = false;
this.tchLocationsGraph.BackColor = System.Drawing.Color.Transparent;
this.tchLocationsGraph.Cursor = System.Windows.Forms.Cursors.Arrow;
//
// tchLocationsGraph.Header
//
this.tchLocationsGraph.Header.AdjustFrame = false;
this.tchLocationsGraph.Header.Lines = new string[] {
"TeeChart"};
this.tchLocationsGraph.Header.Visible = false;
//
// tchLocationsGraph.Legend
//
this.tchLocationsGraph.Legend.ResizeChart = false;
this.tchLocationsGraph.Legend.Visible = false;
this.tchLocationsGraph.Location = new System.Drawing.Point(0, 0);
this.tchLocationsGraph.Name = "tchLocationsGraph";
//
// tchLocationsGraph.Panel
//
//
// tchLocationsGraph.Panel.Bevel
//
this.tchLocationsGraph.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
//
// tchLocationsGraph.Panel.Brush
//
this.tchLocationsGraph.Panel.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255)));
//
// tchLocationsGraph.Panel.Brush.Gradient
//
this.tchLocationsGraph.Panel.Brush.Gradient.Transparency = 100;
this.tchLocationsGraph.Panel.ImageMode = Steema.TeeChart.Drawing.ImageMode.Normal;
this.tchLocationsGraph.Panel.MarginBottom = 0;
this.tchLocationsGraph.Panel.MarginLeft = 0;
this.tchLocationsGraph.Panel.MarginRight = 0;
this.tchLocationsGraph.Panel.MarginTop = 0;
this.tchLocationsGraph.Size = new System.Drawing.Size(536, 224);
this.tchLocationsGraph.TabIndex = 2;
//
// tchLocationsGraph.Walls
//
//
// tchLocationsGraph.Walls.Back
//
//
// tchLocationsGraph.Walls.Back.Brush
//
this.tchLocationsGraph.Walls.Back.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(38)), ((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(192)));
//
// tchLocationsGraph.Walls.Back.Brush.Gradient
//
this.tchLocationsGraph.Walls.Back.Brush.Gradient.Transparency = 85;
this.tchLocationsGraph.Walls.Back.Visible = false;
//
// tchLocationsGraph.Walls.Bottom
//
this.tchLocationsGraph.Walls.Bottom.Visible = false;
//
// tchLocationsGraph.Walls.Left
//
this.tchLocationsGraph.Walls.Left.Visible = false;
this.tchLocationsGraph.Walls.Visible = false;
//
// tchLocationsGraph.Zoom
//
this.tchLocationsGraph.Zoom.Allow = false;
this.tchLocationsGraph.Zoom.MouseButton = System.Windows.Forms.MouseButtons.XButton1;
//
// tchLocationsGraph.Zoom.Pen
//
this.tchLocationsGraph.Zoom.Pen.Visible = false;
this.tchLocationsGraph.ClickSeries += new Steema.TeeChart.TChart.SeriesEventHandler(this.tChart1_ClickSeries);
[/code][/code]
After ugrading from teechart lite to pro, assigning colours to individual points in a points series when you add a point only seems to work randomly.
Here is the code:
[code]
Points origin = new Points();
origin.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
int catchRadius = 5;
origin.Pointer.HorizSize = catchRadius;
origin.Pointer.VertSize = catchRadius;
int dotColour = (int)Math.Round((double)maxCatchColour * ((double)ca.Kg /maxKg),0);
Color col = new Color();
if(dotColour < 20)
col = Color.FromArgb(227,255,94);
else if (dotColour < 40)
col = Color.FromArgb(174,193,84);
else if (dotColour < 60)
col = Color.FromArgb(84,97,23);
else if (dotColour < 80)
col = Color.FromArgb(255,47,47);
else if (dotColour <= 100)
col = Color.FromArgb(172,45,45);
origin.Add(x,y,ca.SpeciesName,col);
origin.Cursor = Cursors.Hand;
[/code]
When there are more than three points some of the points don't pick up the colour set when adding the point (they keep the series colour).
Can any one tell me how to set the colours?
Here is are the chart properties incase they help:
[code]
//
// tchLocationsGraph
//
//
// tchLocationsGraph.Aspect
//
this.tchLocationsGraph.Aspect.View3D = false;
//
// tchLocationsGraph.Axes
//
//
// tchLocationsGraph.Axes.Bottom
//
this.tchLocationsGraph.Axes.Bottom.Automatic = false;
this.tchLocationsGraph.Axes.Bottom.AutomaticMaximum = false;
this.tchLocationsGraph.Axes.Bottom.AutomaticMinimum = false;
this.tchLocationsGraph.Axes.Bottom.Increment = 1;
this.tchLocationsGraph.Axes.Bottom.Maximum = 880;
this.tchLocationsGraph.Axes.Bottom.Minimum = 0;
this.tchLocationsGraph.Axes.Bottom.Visible = false;
this.tchLocationsGraph.Axes.DrawBehind = false;
//
// tchLocationsGraph.Axes.Left
//
this.tchLocationsGraph.Axes.Left.Automatic = false;
this.tchLocationsGraph.Axes.Left.AutomaticMaximum = false;
this.tchLocationsGraph.Axes.Left.AutomaticMinimum = false;
this.tchLocationsGraph.Axes.Left.Increment = 1;
//
// tchLocationsGraph.Axes.Left.Labels
//
this.tchLocationsGraph.Axes.Left.Labels.Style = Steema.TeeChart.AxisLabelStyle.None;
this.tchLocationsGraph.Axes.Left.Labels.Visible = false;
this.tchLocationsGraph.Axes.Left.Maximum = 0;
this.tchLocationsGraph.Axes.Left.Minimum = -623;
//
// tchLocationsGraph.Axes.Left.Title
//
this.tchLocationsGraph.Axes.Left.Title.Visible = false;
this.tchLocationsGraph.Axes.Left.Visible = false;
//
// tchLocationsGraph.Axes.Right
//
this.tchLocationsGraph.Axes.Right.Visible = false;
//
// tchLocationsGraph.Axes.Top
//
this.tchLocationsGraph.Axes.Top.Visible = false;
this.tchLocationsGraph.Axes.Visible = false;
this.tchLocationsGraph.BackColor = System.Drawing.Color.Transparent;
this.tchLocationsGraph.Cursor = System.Windows.Forms.Cursors.Arrow;
//
// tchLocationsGraph.Header
//
this.tchLocationsGraph.Header.AdjustFrame = false;
this.tchLocationsGraph.Header.Lines = new string[] {
"TeeChart"};
this.tchLocationsGraph.Header.Visible = false;
//
// tchLocationsGraph.Legend
//
this.tchLocationsGraph.Legend.ResizeChart = false;
this.tchLocationsGraph.Legend.Visible = false;
this.tchLocationsGraph.Location = new System.Drawing.Point(0, 0);
this.tchLocationsGraph.Name = "tchLocationsGraph";
//
// tchLocationsGraph.Panel
//
//
// tchLocationsGraph.Panel.Bevel
//
this.tchLocationsGraph.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
//
// tchLocationsGraph.Panel.Brush
//
this.tchLocationsGraph.Panel.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255)));
//
// tchLocationsGraph.Panel.Brush.Gradient
//
this.tchLocationsGraph.Panel.Brush.Gradient.Transparency = 100;
this.tchLocationsGraph.Panel.ImageMode = Steema.TeeChart.Drawing.ImageMode.Normal;
this.tchLocationsGraph.Panel.MarginBottom = 0;
this.tchLocationsGraph.Panel.MarginLeft = 0;
this.tchLocationsGraph.Panel.MarginRight = 0;
this.tchLocationsGraph.Panel.MarginTop = 0;
this.tchLocationsGraph.Size = new System.Drawing.Size(536, 224);
this.tchLocationsGraph.TabIndex = 2;
//
// tchLocationsGraph.Walls
//
//
// tchLocationsGraph.Walls.Back
//
//
// tchLocationsGraph.Walls.Back.Brush
//
this.tchLocationsGraph.Walls.Back.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(38)), ((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(192)));
//
// tchLocationsGraph.Walls.Back.Brush.Gradient
//
this.tchLocationsGraph.Walls.Back.Brush.Gradient.Transparency = 85;
this.tchLocationsGraph.Walls.Back.Visible = false;
//
// tchLocationsGraph.Walls.Bottom
//
this.tchLocationsGraph.Walls.Bottom.Visible = false;
//
// tchLocationsGraph.Walls.Left
//
this.tchLocationsGraph.Walls.Left.Visible = false;
this.tchLocationsGraph.Walls.Visible = false;
//
// tchLocationsGraph.Zoom
//
this.tchLocationsGraph.Zoom.Allow = false;
this.tchLocationsGraph.Zoom.MouseButton = System.Windows.Forms.MouseButtons.XButton1;
//
// tchLocationsGraph.Zoom.Pen
//
this.tchLocationsGraph.Zoom.Pen.Visible = false;
this.tchLocationsGraph.ClickSeries += new Steema.TeeChart.TChart.SeriesEventHandler(this.tChart1_ClickSeries);
[/code][/code]