Hi,
how can I change the thickness of the colored lines of a legend? I have 4 series with different colors in my layer and they were also shown in the legend. But the 4 colored lines in the legend are only one pixel thick.
thanks in advance
You can try looking at:
http://forums.infragistics.com/forums/p/5297/23905.aspx#23905
In you case you can change the thickness of the lines with:
box.PE.StrokeWidth = 5;
Hi, I'm also having an issue figuring out how to make the Legend's line thickness match the line thickness that I've specified in the LineChart. I've read your answer, as well as the other thread you referenced, but all that does is make the BOX around the legend bigger. I want the line that represent a Series to match the thickness of what is seen on the graph. How do I do this? Attaching a screen shot.
You can change the height of the small boxes in the legend with:
private void UltraChart1_ChartDrawItem(object sender, ChartDrawItemEventArgs e)
{
int thickness = this.ultraChart1.LineChart.LineAppearances[0].Thickness;
Box box = e.Primitive as Box;
if (box == null)
return;
}
if (string.IsNullOrEmpty(box.Path))
if (box.Path.EndsWith("Legend") == false)
// this is the external legend box
if (box.Column == -1)
// change the box height
box.PE.Stroke = Color.Transparent;
box.rect.Y += (box.rect.Height - thickness) / 2;
box.rect.Height = thickness;
Hi Teodor,
I tried your solution and it did nothing to the line thickness of the Series in the Legend. As stated in my original post, I am not trying to change the thickness of the Box. I'm trying to change the thickness of each 'Line' that is used to represent each Series within the Legend box. If you look at the original snapshot that I posted, you can see that on the Graph, the line thickness of the green and blue lines are thick (in actuality, the thickness is equal to 5). But if you look inside the legend, the green and blue lines are not a thickness of 5. Instead, they look like a thickness of 1. What I want is for the green and blue lines inside of the "Legend" to be a thickness of 5, to match the thickness of 5 on the graph. Please let me know if I'm being unclear.
Sorry, I was missing that you are adding series. Try changing the chart draw item function to:
Polyline polyline = e.Primitive as Polyline;
if (polyline == null)
if (string.IsNullOrEmpty(polyline.Path))
if (polyline.Path.EndsWith("Legend") == false)
// change the stroke width
polyline.PE.StrokeWidth = thickness;
That was it! I've attached a new snapshot to show what it did, in case others are interested in achieving the same result.