Hi,
I have a Heatmap chart that I have customized so that each cell in the chart takes some predefined color. The issue is that the line common between two cells has double the color value (please see below image). Also I need to generate a border around the generated chart( area where the chart is drwan, not including the space for labels).
For coloring each cell, I have used the FillSceneGraph event as follows:
foreach (Primitive p in e.SceneGraph) { if (p.Path == "Border.Title.Grid.Chart") { p.PE.Fill = GetCustomColor(p.Row, p.Column); } }
Please see the image below describing the two issues.
Thanks in advance.
Hi Guys,
Please let me know if my two issues above are not clear or you need any more details on this.
And if its currently not possible to resolve the two issues, then also please confirm that.
Thanks a lot.
Hello sandy_joggy ,
I’ve been looking into your issue and here’s what I’ve found out.
For the HeatMap chart the primitive that would be useful to you in your scenario would be the ones inside the Border.Title.Grid. These would be the primitives that will form the rectangles, lines and borders that will define the HeatMap. From those primitive to outline the chart you’ll need the primitives of type “Line” ( if (p.GetType().Name == "Line") ) and more specifically the ones that are solid (the DrawStyle is “Solid”). Set for those a stroke color to outline the whole grid and it’s width. For each rectangle you can also set a stroke that will outline it and will act as a border. To get those primitives just get those of type “Box”. Through them you can access also the row and column index so you should be able to paint the Stroke (outline) in any color similar to the way you paint the cells of the chart.
Here’s a code snippet of the modified FillSceneGraph event:
protected void UltraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e)
{
foreach (Primitive p in e.SceneGraph)
if (p.Path == "Border.Title.Grid.Chart")
p.PE.Fill = GetCustomColor(p.Row, p.Column);
p.PE.FillOpacity = 200;
}
if (p.Path != null && p.Path.Contains("Border.Title.Grid"))
if (p.GetType().Name == "Line")
if (((Infragistics.UltraChart.Core.Primitives.PrimitiveShape)(p)).lineStyle.DrawStyle.ToString() == Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Solid.ToString())
p.PE.Stroke = Color.Black;
p.PE.StrokeWidth = 2;
p.PE.StrokeOpacity = 200;
else if (p.GetType().Name == "Box")
//Here set the Stroke to your preferable border colour for the cells.
p.PE.Stroke = Color.White;
Also I’m attaching sample for your reference. Please let me know if you need further assistance with this or if you have any questions or concerns.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://ko.infragistics.com/support