原創|其它|編輯:郝浩|2012-11-14 16:57:54.000|閱讀 1291 次
概述:如何自定義 AnyChart 圖表的軸標簽屬性?實際上,我們是無法自定義其屬性的.但我們可以通過將軸標簽替換為其他標簽的方式來改變其屬性.
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
有人問到如何自定義 AnyChart 圖表的軸標簽屬性,實際上,我們是無法自定義其屬性的。但我們可以通過將軸標簽換為其他標簽的方式來改變其屬性。
以 label_settings節點為例,用數據標簽替換軸標簽:
<label_settings enabled="true"> <position anchor="XAxis" /> <background enabled="false"/> <format>{%Name}({%phone})</format> </label_settings>
要禁用原來的軸標簽,將 enabled 設置為"false":
<x_axis enabled="true"> <labels enabled="false"/> </x_axis>
你也可以用extra 標簽替換數據標簽:
<extra_labels> <label enabled="true"> <position anchor="Center" /> <font color="White"/> <format>{%Value}</format> </label> </extra_labels>
以下是帶有自定義屬性"phone"的數據標簽放在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>
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:慧都控件