在d3.js中将图标放在图表的顶部

时间:2016-08-19 16:30:11

标签: javascript d3.js c3.js

我想在轴和图形的顶部放置一个图标。我不知道怎么样,我是新手,如果能提供帮助,我将不胜感激。

https://jsfiddle.net/apg8euad/

c3.generate({
        data: {
            x: 'fecha',
            xFormat: '%d-%m-%Y', // 'xFormat' can be used as custom format of 'x'
            columns:  [[                "Precio",0,547324,515740,515740,236644,544576,515740,547324,547324,547324,544576,147184,120000],["fecha","20-05-2016","27-05-2016","03-06-2016","10-06-2016","17-06-2016","24-06-2016","01-07-2016","08-07-2016","15-07-2016","22-07-2016","29-07-2016","05-08-2016","12-08-2016"]],    
            type:'bar'

        },


        legend: {
              show: true
        },

        axis: {
            x: {
                type: 'timeseries',
                tick: {
                    format: '%Y-%m-%d'
                }
            },
             y : {
                  tick: {
                  format: d3.format("$,")
                   }
             }

        }


});

在这张图片中我放了一个红色矩形。这是我想要这个图标的位置。 (图标可以是任何图像) enter image description here

0 个答案:

没有答案