如何更改 jqPlot 数据点标签上的颜色
我有一个由 jqPlot
生成的图表。 数据点标签用于在图表上显示附加信息,如下例所示: http:// /www.jqplot.com/tests/point-labels.php
如您所见,数据点标签的颜色始终为黑色。 但我想将数据点标签的颜色更改为与图表相同的颜色(顺便说一句:我不谈论图例或刻度标签)。
通过选项页面搜索(http://www.jqplot.com/docs/files /jqPlotOptions-txt.html)我发现没有选项可以更改此颜色。
所以问题是:是否有(其他)方法来更改数据点标签的颜色?
谢谢。
I have a graph generated by jqPlot
.
Data Point Labels are used the show additional information on the graph, like in this example: http://www.jqplot.com/tests/point-labels.php
As you can see, the color of the data point labels is always black.
But I would like to change the color of the data point labels to the same color as the graph is (by the way: I don't talk about the legend or the tick-label).
Searching trough the options page (http://www.jqplot.com/docs/files/jqPlotOptions-txt.html) I found no option to change this color.
So the question is: Is there a (other) way to change the color of the data point labels?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用 CSS 来做到这一点。通过定位类
.jqplot-point-label
。请参阅页面上提供的示例You can do that with CSS. By targeting the class
.jqplot-point-label
. See the example provided on the page除了
.jqplot-series-$i
类之外,阅读源代码发现.jqplot-data-label
类也应用于这些标签项。In addition to the
.jqplot-series-$i
class, reading the source reveals that the.jqplot-data-label
class is also applied to these label items.无需 CSS 即可完成此操作。
当然
,
您可以在 JavaScript 循环中添加一个跨度。
You can do this without CSS.
for series set
and
Of course you can add a span in JavaScript loop.
我正在使用甜甜圈聊天,这就是我更改目标和标签颜色的方法
I was using a donut chat and this is how i changed the target and label color