Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Make Your .NET Data More Useful with Treemap Visualization : Page 3

Using visualizations such as pie charts and bar graphs to present data is nothing new. But what happens when you've got more data points than a pie chart can render? Enter the treemap! Use the .NET Treemap Control to create your own Treemap Application and render any data you like.


advertisement
Variations on the Theme
The Microsoft Treemap control requires your XML to be formatted in a particular way in order to successfully parse and render the data. An example of this XML is seen in the following code:

<Nodes EmptySizeMetric="0"> <Node Text="Americas" SizeMetric="50" ColorMetric="-40.1" ToolTip="Americas"> <Nodes EmptySizeMetric="0"> <Node Text="USA" SizeMetric="100" ColorMetric="0" ToolTip="USA"> <Nodes EmptySizeMetric="0"> <Node Text="Texas" SizeMetric="20" ColorMetric="40" ToolTip="Texas"> <Nodes EmptySizeMetric="0"/> </Node> <Node Text="California" SizeMetric="60" ColorMetric="0" ToolTip="California"> <Nodes EmptySizeMetric="0"/> </Node> </Nodes> </Node> <Node Text="Canada" SizeMetric="20" ColorMetric="200" ToolTip="Canada"> <Nodes EmptySizeMetric="0"/> </Node> </Nodes> </Node> <Node Text="Europe" SizeMetric="25" ColorMetric="100" ToolTip="Europe"> <Nodes EmptySizeMetric="0"/> </Node> </Nodes>

The control also has a property NodesXML which, when set with a string containing valid XML, sets up the internal data structures for the treemap. Build your treemap in this way by using the following code:

XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("c:\\treemap.xml"); tmcMap.NodesXml = xmlDoc.InnerXml; tmcMap.Draw();

You can also build a treemap from the output of a Web service. It's very simple to do in Visual Studio.NET. Simply have your Web method return XML in the above format as type XMLDocument. This XML can then be passed to the NodesXML property like in the XML example above.



Visualization Equals Data Simplification
This method is an incredibly useful way of looking at data. It allows for a much better overview of complex data than you get with traditional visualizations. The Microsoft Research treemap control provides an easy way to implement this technology. Use the basics you have gleaned here to explore the next level and add value to your data applications.



Laurence Moroney is a senior architect with a major financial services house in New York City. He has worked in the computer field for over 10 years and has developed software in many fields, including financial services, security, and professional sports. E-mail him at lmoroney@philotic.com.
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap