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
523
Show Legends when I swap rows into Columns
posted

I am having a simple problem. My data looks like this

Date             AppleCount       OrangeCount     BananaCount 

01/01/1990    100                           200            300

....

01/01/2008     300                          400             800

 

I am trying display this in line chart, and I did SwapRowsAndColumns="True" , Works fine but when I say show legend it shows all the rows in the legend, Basically what I want is 3 items in the legend - Apple, Orange and Banana . But infragistics autometically shows all the rows as legends. how to fix this ??

Infact I want column name to be my legends 

 

Parents
  • 17605
    posted

    I've been trying this:

    DataTable table = new DataTable();

    table.Columns.Add("Date", typeof(DateTime));

    table.Columns.Add("Apple", typeof(double));

    table.Columns.Add("Orange", typeof(double));

    table.Columns.Add("Banana", typeof(double));

    table.Rows.Add(new object[ { DateTime.Now, 100, 200, 300 });

    table.Rows.Add(new object[ { DateTime.Now.AddDays(1), 300, 400, 800 });

    table.Rows.Add(new object[ { DateTime.Now.AddDays(2), 400, 500, 200 });

    this.UltraChart1.Data.SwapRowsAndColumns = true;

    this.UltraChart1.Legend.Visible = true;

    this.UltraChart1.DataSource = table;

    this.UltraChart1.DataBind();

    And the legend shows Apple, Orange, Banana.

    Could you attach your project so we can investigate the problem?

Reply Children