原創(chuàng)|使用教程|編輯:郝浩|2013-06-26 10:18:16.000|閱讀 340 次
概述:使用AnyMap除了創(chuàng)建Self Drilldown Maps之外,還可以創(chuàng)建Self Drilldown Maps。下面看一下具體的示例。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
使用Flash地圖控件AnyMap除了創(chuàng)建Self Drilldown Maps之外,還可以創(chuàng)建Self Drilldown Maps。下面看一下具體的示例——地圖由兩部分組成,第一部分將包含美國(guó)的地圖,當(dāng)用戶單擊特定的州——該州的地圖就將在地圖的第二部分進(jìn)行顯示。
創(chuàng)建儀表板布局
創(chuàng)建這樣的地圖需要使用AnyChart儀表板功能,儀表板將包含兩個(gè)部分,以下面的代碼進(jìn)行創(chuàng)建:
<?xml version="1.0" encoding="UTF-8"?> <anychart> <dashboard> <view type="Dashboard"> <title> <text>USA Drilldown Map</text> </title> <hbox width="100%" height="100%"> <view name="Country" type="Chart" width="50%" height="100%" source="USA" /> <view name="State" type="Chart" width="50%" height="100%" /> </hbox> </view> </dashboard> </anychart>
為地圖創(chuàng)建圖表
以下面的代碼進(jìn)行創(chuàng)建:
<chart plot_type="Map" name="USA"> <chart_settings> <title enabled="false" /> <chart_background enabled="false" /> <data_plot_background enabled="false" /> </chart_settings> <data_plot_settings> <map_series source="usa/country/states.amap"> <projection type="orthographic" /> <undefined_map_region palette="Default"> <actions> <action type="updateView" view="State" source_mode="internalData" source="State"> <replace token="{$region_amap}">{%REGION_ID}</replace> <replace token="{$title}">{%REGION_NAME}</replace> </action> </actions> </undefined_map_region> </map_series> </data_plot_settings> </chart>
這個(gè)操作定義意味著AnyChart應(yīng)在"State"視圖中加載"State"圖表,并使用{%REGION_ID}和{%REGION_NAME}關(guān)鍵字參數(shù)來(lái)取代{$region_amap}和{$title}符號(hào)。
中間結(jié)果——具有一個(gè)定義地圖的Dashboard
如果將描述的圖表添加到儀表板,將會(huì)得到如下所示的地圖:
州地圖的XML
創(chuàng)建美國(guó)所有州的XML,需要使用一個(gè)參數(shù)化的XML,{$title}和{$region_amap}符號(hào)將會(huì)由主圖表<action>進(jìn)行處理:
<chart plot_type="Map" name="State"> <chart_settings> <title> <text>{$title}</text> </title> <chart_background enabled="false" /> <data_plot_background enabled="false" /> </chart_settings> <data_plot_settings> <map_series source="usa/states/counties/{$region_amap}.amap"> <projection type="orthographic" /> <undefined_map_region palette="Default" /> </map_series> </data_plot_settings> </chart>
最終的Drilldown Dashboard
只需要將 "State" 圖表添加到<charts>部分,儀表板就完成了
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@ke049m.cn
文章轉(zhuǎn)載自:慧都控件網(wǎng)