AnyChart如何在坐标轴上使用自定义文本标记

作者:控件中国网   出处:控件中国网   2015-08-27 10:17:36   阅读:2

文本标记可以用于客户想使用自定义文本或者描述来替代坐标轴原有值时使用,开发人员可以添加文本标记到图表中的任何地方,AnyChart为文本标记提供了多种属性和方法: .textMarker()、set .value()、.scale() 和 .text()等来对文本标记进行各种设置,具体使用可以参考下面的部分代码:

chart.textMarker()
  .scale(chart.yScale())
  .value(18000)
  .align('left')
  .anchor('leftcenter')
  .fontSize(12)
  .fontColor('#212121')
  .offsetX(5)
  .text('Historical Maximum');

<a href=http://www.componentcn.com/kaifashang/guojikaifashang/2014-06-11/1.html target=_blank class=infotextkey>AnyChart</a>1.png

或者

chart.textMarker(2)
  .scale(chart.yScale())
  .value(13)
  .text('Align: right')
  .align('right')
  .offsetX(5)
  .fontColor('#212121')
  .anchor('rightcenter');
 

<a href=http://www.componentcn.com/kaifashang/guojikaifashang/2014-06-11/1.html target=_blank class=infotextkey>AnyChart</a>2.png

Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat