Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用人力车(http://code.shutterstock.com/rickshaw/)并希望在图形的一个轴上而不是数字上有字符串。有可能这样做吗?如果是这样,怎么做?
可以定义和使用您自己的格式化程序
Rickshaw.Fixtures.Number.myFormat = (y) -> if (y == val) return 'somestring'; else return ''some other string';
将此用作:
yAxis = new Rickshaw.Graph.Axis.Y graph: graph tickFormat: Rickshaw.Fixtures.Number.myFormat graph.render()