如何在c3.js图表​​中添加标题 [英] How can I add a title to c3.js chart

查看:95
本文介绍了如何在c3.js图表​​中添加标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以建议我为C3.js折线图和条形图添加标题的方法吗?我有以下示例,但用于量规表。对于任何c3图表,是否都可以设置图表标题?

Can any one suggest me the way of adding title to the C3.js line and bar charts ? I have got the following sample but it is for gauge chart. For any c3 chart is there any option to set the chart title?

donut: {
  title: 'Title'
}


推荐答案

您需要回退到使用D3添加图表标题。像这样的东西:

You'd need to fall back to using D3 to add a chart title. Something like:

d3.select("svg").append("text")
    .attr("x", 100 )
    .attr("y", 50)
    .style("text-anchor", "middle")
    .text("Your chart title goes here");

这篇关于如何在c3.js图表​​中添加标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆