I have a legend on a composite chart but the legend overlaps the the chart area. How do I fix it?
var legend = new CompositeLegend(); legend.ChartLayers.Add(layer); legend.Bounds = new Rectangle(5, 85, 80, 12); legend.BoundsMeasureType = MeasureType.Percentage;legend.PE.ElementType = PaintElementType.Gradient;legend.PE.FillGradientStyle = GradientStyle.ForwardDiagonal;legend.PE.Fill = Color.CornflowerBlue;legend.PE.FillStopColor = Color.Transparent;legend.Border.CornerRadius = 10;legend.Border.Thickness = 1;ultraChart.CompositeChart.Legends.Add(legend);
Thanks! I'll watch the video.
Sample
Here is the video tutorial
Hello Michael,
The size and location of your legend depend of the settings in Bounds properties:
legend.Bounds = new Rectangle(5, 85, 80, 12);
but these settings are related also with BoundsMeasureType property. In your scenario you are using Percentage option, but if you want you could use Pixels option
To prevent overlaps, you could modify the Bounds properties, but looking on the screenshot (it seems that you are using one of my samples), maybe in your case it is not enough, so you could modify the Bounds property of your Area. For example:
ChartArea area = new ChartArea();
area.Bounds =new Rectangle(0, 0, 700, 350);
this.ultraChart1.CompositeChart.ChartAreas.Add(area);
Please take a look on attached sample and video file for more details and let me know if you have any questions