I'm going to post an idea (and code) for how you might go about doing this, but it's based on these assumptions:
1. that what you want here is a "Table" more than it is a "Graph."
2. that if you get your data ... the outcome of rule evaluation ... in the right data structures, that actually doing the drawing is something you know how to do.
Example: assume you have evaluated your rules and generated this data; a jagged array is used here, but the type of Array or generic List hardly matters: the only important thing is you know how to get the values, and the appropriate row/column headers, for the grid:
string[][] data = new string[][]
{
new string[] {"AA","KJ","LR"},
new string[] {"VC", "QJ"},
new string[] {"A", "B", "D", "E", "Z", "X"}
};
To "stay honest" let's write a format test will match the graphic goal:
for (int i = 0; i < data[0].Length; i++)
{
Console.Write("{0}{1}", data[0][i], "\t");
for (int j = 0; j < data[1].Length; j++)
{
Console.Write("\t{0}{1}",data[2][(i * 2) + j], "\t");
}
Console.WriteLine();
}
foreach (var str in data[1]) Console.Write("\t\t{0}", str);
So, let's rough-sketch out what you do, then, to create the graphic representation ... remember this is just an idea ...
0. create some kind of map between data-values and colors (Dictionary ?)
1. for each row:
a. show the row ID: use a Label ?
b. for each column in the row
1. create a Panel and set its backcolor based on your value to color map (#0)
2. put the value in the Panel ... a Label Control centered in the Panel ?
3. position the Panel in the row.
4. when all rows are finished: do the right thing to create the column labels below the last row.
This sketch has considered using objects (Panels, Labels) rather than using Drawing; but, there's nothing stopping you from using the Paint Event, brushes, pens, etc.