原創(chuàng)|其它|編輯:郝浩|2012-11-14 16:57:54.000|閱讀 1291 次
概述:如何自定義 AnyChart 圖表的軸標(biāo)簽屬性?實(shí)際上,我們是無法自定義其屬性的.但我們可以通過將軸標(biāo)簽替換為其他標(biāo)簽的方式來改變其屬性.
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
有人問到如何自定義 AnyChart 圖表的軸標(biāo)簽屬性,實(shí)際上,我們是無法自定義其屬性的。但我們可以通過將軸標(biāo)簽換為其他標(biāo)簽的方式來改變其屬性。
以 label_settings節(jié)點(diǎn)為例,用數(shù)據(jù)標(biāo)簽替換軸標(biāo)簽:
<label_settings enabled="true"> <position anchor="XAxis" /> <background enabled="false"/> <format>{%Name}({%phone})</format> </label_settings>
要禁用原來的軸標(biāo)簽,將 enabled 設(shè)置為"false":
<x_axis enabled="true"> <labels enabled="false"/> </x_axis>
你也可以用extra 標(biāo)簽替換數(shù)據(jù)標(biāo)簽:
<extra_labels> <label enabled="true"> <position anchor="Center" /> <font color="White"/> <format>{%Value}</format> </label> </extra_labels>
以下是帶有自定義屬性"phone"的數(shù)據(jù)標(biāo)簽放在X軸上的代碼示例:
<anychart> <charts> <chart plot_type="CategorizedHorizontal"> <data_plot_settings default_series_type="Bar"> <bar_series> <label_settings enabled="true"> <position anchor="XAxis" /> <background enabled="false"/> <format>{%Name}({%phone})</format> </label_settings> <extra_labels> <label enabled="true"> <position anchor="Center" /> <font color="White"/> <format>{%Value}</format> </label> </extra_labels> </bar_series> </data_plot_settings> <data> <series name="HQ"> <attributes> <attribute name="location">LA</attribute> </attributes> <point name="John" y="17000"> <attributes> <attribute name="phone">555-1267</attribute> </attributes> </point> <point name="Jake" y="19000"> <attributes> <attribute name="phone">555-6790</attribute> </attributes> </point> <point name="Peter" y="18000"> <attributes> <attribute name="phone">555-0112</attribute> </attributes> </point> </series> </data> <chart_settings> <title enabled="false"/> <axes> <y_axis enabled="true" position="Opposite"> <scale minimum="0"/> </y_axis> <x_axis enabled="true"> <labels enabled="false"/> </x_axis> </axes> </chart_settings> </chart> </charts> </anychart>
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都控件