Skip to content

Part of the tooltip element is undefined #940

Closed
@soyme

Description

Description

When drawing multiple data in a chart, some of tooltips are not shown normally as below.
biilboard_tooltip
In this screenshot, the text undefineddownload300 is the tooltip...

I found that <table><tr><th></th></tr> tag is missing in the tooltip element. I think that It occurred when some of fields in the data is undefined or null.

{name: "data1", upload: 200 },   // "download" field is undefined
{name: "data2", upload: 100, download: 300},  // OK
{name: "data3", upload: null, download: 300}  // "upload" field is null

Should I modify my data not to have null or undefined?
Or Could I or someone make a patch for fixing it?

Steps to check or reproduce

var chart = bb.generate({
    data: {
        columns: [
            ["data1", 30, 200, null, 400, 150, 250],
            ["data2", 50, 20, 10, 40, null, 25]
        ]
    },
    bindto: "#chart"
});

in case of JSON data

var chart = bb.generate({
    bindto: "#chart",
    data: {
        json: [{
            name: "data1",
            upload: 200
        },
            {
                name: "data2",
                upload: 100,
                download: 300
            },
            {
                name: "data3",
                download: 300
            }
        ],
        keys: {
            x: "name",
            value: ["upload", "download"],
        }
    },
    axis: {
        x: {
            type: "category"
        }
    }
});

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions