dhtmlXDataMap is a component that visualizes a data set depending on some property of items. Items are displayed as rectangles with different sizes: the bigger area corresponds to the bigger property size.
To initialize datamap, you need to
There are four files that need to be included
<script src="../../codebase/dhtmlxdataview.js" type="text/javascript"></script> <script src="../../codebase/ext/dhtmlxdatamap.js" type="text/javascript"></script> <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxdataview.css"> <link rel="STYLESHEET" type="text/css" href="../../codebase/ext/dhtmlxdatamap.css">
DataMap initialized in HTML container:
<<div id="map_container" style="width:600px;height:400px"></div>
To initilize DataMap you need to pass “type”, “container” and “size” elements:
var map = new dhtmlXDataMap({ type:{ template: "<span class='dhx_strong'>#author#</span>#title#<p >Price: <b>#price#</b></p>", template_edit:"<textarea class='dhx_item_editor' bind='obj.title'>" }, container:"map_container", size:"price" });
Elements of the dhtmlXDataMap constructor:
DataMap supports the same methods for data loading as DataView:
map.load("books.xml","xml");