最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Show color thresholds in c3.js gauge - Stack Overflow

programmeradmin1浏览0评论

I'm trying to configure a c3gauge chart but I would like to show the threshold values in the chart (outside labels with the color would be nice) just to realize how far the value is from the next level.

Any one can help me?

This is the gauge now:

This is what I expect:

I'm trying to configure a c3gauge chart but I would like to show the threshold values in the chart (outside labels with the color would be nice) just to realize how far the value is from the next level.

Any one can help me?

This is the gauge now:

This is what I expect:

Share Improve this question edited Jan 12, 2018 at 20:41 Danny Fardy Jhonston Bermúdez 5,5715 gold badges26 silver badges38 bronze badges asked May 12, 2015 at 6:18 user1948455user1948455 2012 silver badges4 bronze badges 1
  • 2 Hard to know what you're wanting from that question. Could you rephrase/elaborate? – Sean Commented May 12, 2015 at 16:31
Add a ment  | 

1 Answer 1

Reset to default 7 +25

There is no specific option in c3.js Gauge chart to draw thresholds lines and legends, so I thought to use d3.js to add them to chart on rendered event:

onrendered: function() {
    drawThresholds(this, thresholdOpts, opts);
}

Check this jsfiddle for plete example: https://jsfiddle/beaver71/032tcczg/

Output obtained looks like below:

and:

发布评论

评论列表(0)

  1. 暂无评论