Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Chart > Unable to format&style Legend properly

Not answered Unable to format&style Legend properly

Feed from this thread
  • Posted on Jan 25, 2012 (permalink)

    Currently I am trying to format and style a chart legend according to the design given to me by the design team on the project.

    *see attached image ChartDesign.PNG*

    However I am sofar unable to even put the chart Legend in the correct position, let alone divide the markers.

    The code below would logically do the trick to position the block to bottom left but it stays at bottom CENTER.
    chart.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.BottomLeft;

    *edit*
    I just found out by trial and error that the line
    chart.AutoLayout = true;
    Prevents the legend from being aligned to the left.. I still find this quite strange and would expect other behaviour.
    */edit*

    Can anyone give me some tips or hints on how to move the legend to bottom left and divide the items so that it won't be just a long vertical list?

    Cheers,

    Maarten
    Attached files

    Reply

  • Posted on Jan 25, 2012 (permalink)

    Update;

    I have found a workaround, but this really feels more like a dirty hack, rather than best practice:

    chart.AutoLayout = true;
    chart.Legend.Appearance.Dimensions.AutoSize =
    false;
    chart.Legend.Appearance.Dimensions.Height = 75;
    chart.Legend.Appearance.Dimensions.Width = new Telerik.Charting.Styles.Unit(chart.Width.Value);
    chart.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.BottomLeft;

    This way the chart still scales automatically to available width and the legend box is sized the width of the entire graph and with a height just big enough for 3 series and thus forces the graph legend to position bottom left with 3 items per column.
    See also attached screenshot for result.
    Attached files

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Chart > Unable to format&style Legend properly
Related resources for "Unable to format&style Legend properly"

ASP.NET Chart Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]