charts - dimple.js 图表中图表和轴的标题

标签 charts dimple.js

如何为 dimple.js 图表添加标题? 我想更新图表和轴的标题。我正在使用dimple.js。请指教。

最佳答案

您可以添加带有小 d3 的标题。这是中心标题的示例。为简单起见,我将样式放在 d3 中,但给它一个类并在 css 中设置样式可能会更整洁:

svg.append("text")
   .attr("x", c._xPixels() + c._widthPixels() / 2)
   .attr("y", c._yPixels() - 20)
   .style("text-anchor", "middle")
   .style("font-family", "sans-serif")
   .style("font-weight", "bold")
   .text("My brilliant chart about a and b");

http://jsbin.com/hosobo/4/edit?js,output

关于charts - dimple.js 图表中图表和轴的标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25416063/

相关文章:

javascript - 仅当我们在 Chrome 浏览器中按 F12(开发者工具)时, Highcharts 才会显示数据

charts - 谷歌图表 vAxis 标签的自定义格式

javascript - 如何将凹坑测量轴中的一百万显示为 1000k 而不是 1m?

javascript - 条形图的dimple js x轴日期问题

javascript - 如何更正 D3 凹坑类别轴的顺序?

nvd3.js - Crossfilter 兼容图表库/DC.js 替代方案

javascript - 如何调整 Flot 库插件之一的大小?

javascript - 分组条形图和折线图

c# - devexpress XtraChart : Line Chart years in x-axis showing in decimal and unable to set MaxValueInternal for wholerange and visualrange

javascript - 有没有办法为使用 dimplejs 制作的条形图添加水平滚动条?