How to access additional legend labels in c3.js or billboard.js using JSON data?

I'm working with the following code snippet:

    ... normen is my json object ....               
        $.each(normen, function(item) {
            chartX.push(this.feed_day)
            chartY.push(this.weight)
        });
        createChart(chartX,chartY)
    });


function createChart(chartX,chartY){
    var chart = bb.generate({
        bindto: "#contentarea",
        data: {
            columns: columns:[chartX,chartY],
            names:{
                chartX: 'label for X',
                chartY: "label for Y"
            }
        },    
        title: {
            text: "Blabla"
        },
    });
}

All I want to do is add some custom labels. What is the best way to achieve this? I've tried various options but so far I only see 43 and null as legend labels.

Answer №1

Understood. I made sure to include the label as the initial element in my arrays.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Bring in a JavaScript file from Blogger without using a tag

Is there a way to retrieve blogger feeds code without using