Home Forums WinForms controls Xceed Chart for WinForms Line Series Issue

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18809 |

    Hi

    I want to have a line chart with two lines, and one point

    On X axis, there are five values A,B,C,D,E
    On Y axis, there are five values 1,2,3,4,5

    I want to draw Line1(Blue) from point(A,1) to Point (B,2)

    I also want to draw Line2(Orange) from point(D,4) to Point (E,5)

    I want to have a Point(Red) at point(C,3)

    But currenlty i am getting results as below.

    Line1(Blue) from point(A,1) to Point (B,2)
    Line2(Orange) from point(A,$) to Point (B,5)
    Point(Red) at point(A,3)

    Looking forward to hear from you

    Thanks,
    Keshav

    Imported from legacy forums. Posted by rkeshavr (had 2632 views)

    Xceed Support
    Member
    Post count: 5658

    Here is a good start on what you are looking for:

    e.g.,
    <code>
    private void Form1_Load( object sender, EventArgs e )
    {
    Chart chart = chartControl1.Charts.Add();

    LineSeries lineSerie1 = (LineSeries) chart.Series.Add( SeriesType.Line );
    lineSerie1.UseXValues = true;

    LineSeries lineSerie2 = ( LineSeries )chart.Series.Add( SeriesType.Line );
    lineSerie2.UseXValues = true;

    LineSeries lineSerie3 = ( LineSeries )chart.Series.Add( SeriesType.Line );
    lineSerie3.UseXValues = true;

    lineSerie1.LineBorder.Color = Color.Blue;
    lineSerie2.LineBorder.Color = Color.Pink;
    lineSerie3.LineBorder.Color = Color.Yellow;

    lineSerie1.Markers.Visible = true;
    lineSerie1.Markers.FillEffect.Color = Color.Blue;
    lineSerie1.Markers.Style = PointStyle.Cylinder;
    lineSerie1.Markers.Height = 2;
    lineSerie1.Markers.Width = 2;
    lineSerie2.Markers.Visible = true;
    lineSerie2.Markers.FillEffect.Color = Color.Pink;
    lineSerie2.Markers.Style = PointStyle.Cylinder;
    lineSerie2.Markers.Height = 2;
    lineSerie2.Markers.Width = 2;
    lineSerie3.Markers.Visible = true;
    lineSerie3.Markers.FillEffect.Color = Color.Yellow;
    lineSerie3.Markers.Style = PointStyle.Cylinder;
    lineSerie3.Markers.Height = 2;
    lineSerie3.Markers.Width = 2;

    lineSerie1.DataLabels.Mode = DataLabelsMode.None;
    lineSerie2.DataLabels.Mode = DataLabelsMode.None;
    lineSerie3.DataLabels.Mode = DataLabelsMode.None;

    lineSerie1.AddXY( 1, 1 );
    lineSerie1.AddXY( 3, 2 );
    lineSerie2.AddXY( 3, 3 );
    lineSerie3.AddXY( 3, 4 );
    lineSerie3.AddXY( 5, 5 );
    chart.Axis( StandardAxis.PrimaryX ).ScaleMode = AxisScaleMode.Numeric;
    chart.Axis( StandardAxis.PrimaryX ).NumericScale.AutoMax = false;
    chart.Axis( StandardAxis.PrimaryX ).NumericScale.AutoMin = false;
    chart.Axis( StandardAxis.PrimaryX ).NumericScale.Max = 6;
    chart.Axis( StandardAxis.PrimaryX ).NumericScale.Min = 0;

    chart.Axis( StandardAxis.PrimaryY ).ScaleMode = AxisScaleMode.Numeric;
    chart.Axis( StandardAxis.PrimaryY ).NumericScale.AutoMax = false;
    chart.Axis( StandardAxis.PrimaryY ).NumericScale.AutoMin = false;
    chart.Axis( StandardAxis.PrimaryY ).NumericScale.Max = 6;
    chart.Axis( StandardAxis.PrimaryY ).NumericScale.Min = 0;
    }
    </code>

    Imported from legacy forums. Posted by CharlesB (had 236 views)

    User (Old forums)
    Member
    Post count: 23064

    Charles
    Thanks a lot for the help

    Imported from legacy forums. Posted by rkeshavr (had 3553 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.