Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
how to work with line chart..
posted

Dear All,

please help me iam new ti this chart controls..iam unable to develop the charts..please help me with valid Examples.my requrement is i want show line chart with 3 lines having 3 values Ex:green line for Good ,value= 80, Yellow line value= 50 and Red line  value= 30 like i have to show 3 lines please help hw to do it in Asp.net and c#.net

 

Help me with code

 

Thanking you..

Parents
No Data
Reply
  • 26458
    Offline posted

    Here's an example:

    DataTable table = new DataTable();
    table.Columns.Add("Label", typeof(string));
    table.Columns.Add("Value", typeof(double));
    table.Rows.Add(new object[] { "Green", 80 });
    table.Rows.Add(new object[] { "Yellow", 50 });
    table.Rows.Add(new object[] { "Red", 30 });

    ultraChart1.ChartType = ChartType.LineChart;

    Color[] colors = new Color[] { Color.Green, Color.Yellow, Color.Red };
    ultraChart1.ColorModel.ModelStyle = ColorModels.CustomLinear;
    ultraChart1.ColorModel.CustomPalette = colors;

    ultraChart1.Data.ZeroAligned = true;
    ultraChart1.Data.DataSource = table;
    ultraChart1.Data.DataBind();

Children