0

i creat a bar-chart with c3.js. Is it possible to show an image, when someone click / mouseover on one bar?

var chart = c3.generate({
bindto: '#chart',
title: {
                    text: 'My Title'
                },
                data: {
                    columns: [
                        ['data_1', 10,20,30,40],
                        ['data_2', 5,25,30,22,21],
                        ['data_3', 7,22,1,3,4,5]
                    ],
                    type: 'bar',
                    onclick: function (e) {
                        alert(e.value);

                        console.log("test");
                    }, ...

i found the onclick function, but that shows me the value of a bar. I want to display a picture with more information of the bar. In best case, in a seperate div-container.

thanks a lot.

inProcess
  • 43
  • 6
  • i found this. I will try this later. https://www.competa.com/blog/how-create-tooltips-in-d3-js/ – inProcess Feb 25 '19 at 10:12
  • Take a look of following thread It will may help you. https://stackoverflow.com/questions/24754239/how-to-change-tooltip-content-in-c3js – Azeem Aslam Feb 25 '19 at 11:19

0 Answers0