1

i have the following dataset

NAME | GP   | ORD_GP | EXP   | TOTAL GP | TARGET
a      206     48      -239     15         1600
b      0       27       0        27        1520

iv managed to display the TOTAL GP on the chart using the code

    Chart1.BackColor = Color.Gray;
    Chart1.BackSecondaryColor = Color.WhiteSmoke;
    Chart1.BackGradientStyle = GradientStyle.DiagonalRight;

    Chart1.BorderlineDashStyle = ChartDashStyle.Solid;
    Chart1.BorderlineColor = Color.Gray;
    Chart1.BorderSkin.SkinStyle = BorderSkinStyle.Emboss;

    // format the chart area
    Chart1.ChartAreas[0].BackColor = Color.Wheat;
    // add and format the title
    Chart1.Titles.Add("TOTAL GP Against TARGET  ");
    Chart1.Titles[0].Font = new Font("Utopia", 16);

    Chart1.Series.Add(new Series("TotalGP")
    {
        ChartType = SeriesChartType.Column,
    });

    Chart1.Series.Add(new Series("Target")
    {
        ChartType = SeriesChartType.Column,
    });

    Chart1.Series[0].ChartType = SeriesChartType.Column;

    DataView dataView = new DataView(ds.Tables[0]);

    Chart1.Series[0].Points.DataBindXY(dataView, "NAME", dataView, "TOTAL_GP");

please can some one tell me how i can plot the target on the same chart ?

UPDATE

also how do i get the chart to show the values for each column ?

2 Answers 2

2

You just need to databind the second column to some source data

Chart1.Series[1].Points.DataBindXY(dataView, "NAME", dataView, "TARGET");
Sign up to request clarification or add additional context in comments.

Comments

1

http://code.google.com/intl/tr-TR/apis/chart/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.