原創|使用教程|編輯:郝浩|2013-07-09 16:37:44.000|閱讀 584 次
概述:在本教程中,我們將對Flash地圖控件AnyMap中經常會用到的圖例進行一個詳細的說明,并展示幾個圖例的使用示例和如何顯示圖例中的閾值。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
在本教程中,我們將對Flash地圖控件AnyMap中經常會用到的圖例進行一個詳細的說明,并展示幾個圖例的使用示例和如何顯示圖例中的閾值。
通常圖例是用來顯示地圖上的區域名稱,也有可能是一些地區的附加值,例如某些地區的銷售額。
在下面的示例中我們將創建一份附帶有美國各州銷售額情況的地圖(地圖中的彩色州是ACME公司商品的銷售地點)。
按照下列方式將數據附加到這些地區中:
<series type="MapRegions"> <point y="2000" name="WA" /> <point y="2000" name="OR" /> <point y="2500" name="ID" /> <point y="500" name="MT" /> <point y="3000" name="WY" /> </series>
圖例將放置到地圖的右邊,其格式設置為顯示區域名稱和附加到區域的值:
<legend enabled="true" ignore_auto_item="True" position="Right" align="Near" align_by="dataplot" columns="1" width="30%" horizontal_padding="0">
<title enabled="true">
<text>Sales Per Region</text>
</title>
<columns_separator enabled="false" />
<font render_as_html="true" />
<items>
<item source="points" series="Details">
<text><![CDATA[%cbegin<font size="12" face="Verdana"><textformat tabstops='[100]'>{%REGION_NAME} ${%Value}{numDecimals:0}</textformat></font>%cend]]></text>
</item>
<item source="series" series="Details">
<text><![CDATA[%cbegin<font size="12" face="Verdana"><textformat tabstops='[100]'><b>Total: ${%DataPlotYSum}{numDecimals:0}</textformat></b></font>%cend]]></text>
</item>
</items>
</legend>
注意:<textformat tabstops='[100]'>用于創建圖表層。

當用戶想將一些數據分散到不同的圖例中時就會用到多圖例,在下面的示例中我們將把同樣的銷售數據附到一個圖例中,然后在另一個表中展現ACME公司的計劃擴張區域。
在<chart_settings>的<controls>節點設置另外的圖例:
<controls>
<legend enabled="true" ignore_auto_item="True" position="Right" align="Near" align_by="dataplot" columns="1" width="30%" horizontal_padding="0">
<title enabled="true">
<text>Expansion</text>
</title>
<columns_separator enabled="false" />
<items>
<item source="points" series="Expansion">
<text>{%Icon} {%REGION_NAME} ({%PlannedExpansionPeriod}{enabled:False})</text>
</item>
</items>
</legend>
</controls>
這個圖例將會顯示"Expansion" 系列,并被放置到上一個圖例的下面。此外還添加了自定義PlannedExpansionPeriod屬性在"Expansion"系列的點上,并在該圖例和提示中顯示屬性值。

當使用閥值為地圖進行彩色渲染時,可以將這個閾值添加到圖例中,以便其描述會顯示。
為此應該設置圖例項。下面是帶有自定義閾值的地圖示例。
<legend enabled="true" position="float" inside_dataplot="true" anchor="RightTop" horizontal_padding="5" vertical_padding="5" ignore_auto_item="true">
<title>
<text>Illiteracy Rate</text>
</title>
<items>
<item source="Thresholds" thrshold="thrIlliteracy" />
</items>
</legend>

顯示地圖中的未定義區域,應該使用一個內置的系列名稱——"AnyChart_UndefinedRegions"。
<items> <item source="points" series="AnyChart_UndefinedRegions" /> </items>

本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@ke049m.cn
文章轉載自:慧都控件網