User (Old forums)MemberNovember 23, 2007 at 5:20 amPost count: 23064
According to DataRows in DataTable I got that much no. of line series in my chart.
now I want that for each row,each line series must be in diff color.
I dont how many line series wll be created and drawn by user.Its tatally dynamic.
According to data ,datarows wll be there in datatable and I want digg color for each line series that diaply the data in chart.
I m very confuse that how can i manage it.
Thanx in advance.
I need y r help very soon if u can.
Imported from legacy forums. Posted by khushboo (had 2140 views)Xceed SupportMemberNovember 23, 2007 at 2:15 pmPost count: 5658
I am not sure to completely understand your inquiry. If you are trying to change the color of the line you are adding, you just need to modify the LineBorder.Color property.
The following code adds a line (with a randomly chosen color) to a Chart with a button click.
random = new Random();
private Xceed.Chart.Core.Chart m_Chart;
private Random random;
private void Form1_Load( object sender, EventArgs e )
m_ChartControl.Settings.RenderDevice = RenderDevice.GDI;
m_ChartControl.Background.FillEffect.SetGradient( GradientStyle.Horizontal, GradientVariant.Variant2, Color.Ivory, Color.Khaki );
// add a header label
ChartLabel header = m_ChartControl.Labels.AddHeader( “Different Color Lines” );
header.TextProps.Backplane.Visible = false;
header.TextProps.FillEffect.Color = Color.Navy;
header.TextProps.Shadow.Type = ShadowType.Solid;
header.TextProps.HorzAlign = HorzAlign.Left;
header.TextProps.VertAlign = VertAlign.Top;
header.HorizontalMargin = 2;
header.VerticalMargin = 2;
m_Chart = m_ChartControl.Charts[ 0 ];
m_Chart.Axis( StandardAxis.Depth ).Visible = false;
private void butAddLine_Click( object sender, EventArgs e )
LineSeries m_Line = ( LineSeries )m_Chart.Series.Add( SeriesType.Line );
m_Line.Name = “Line Serie ” + m_Chart.Series.Count.ToString();
m_Line.DataLabels.Mode = DataLabelsMode.None;
m_Line.Markers.Style = PointStyle.Cylinder;
m_Line.Values.FillRandom( 5 );
m_Line.LineBorder.Color = Color.FromArgb( random.Next( 255 ), random.Next( 255 ), random.Next( 255 ) );
m_Line.LineBorder.Width = 3;
private void butClear_Click( object sender, EventArgs e )
Imported from legacy forums. Posted by CharlesB (had 3126 views)
- You must be logged in to reply to this topic.