Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Word cloud showing value(weight) with Key(word) #14

Closed
syed-asim opened this issue Dec 13, 2021 · 1 comment
Closed

Word cloud showing value(weight) with Key(word) #14

syed-asim opened this issue Dec 13, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@syed-asim
Copy link

Hi, Wordcloud is showing numbers along with words. The numbers are display in small size. How can I hide the numbers (i.e. the value field)?

Here's my code:
const chart = new Chart(document.getElementById(visual.VisualId).getContext("2d"), {
type: "wordCloud",
data: {
labels: words2.map((d) => d.key),
datasets: [
{
label: "",
data: words2.map((d) =>d.value)
}
]
},
options: {
color: ThemeCols[0].toString(),
fit:true,
padding: 2,
title: {
display: false,
},
plugins: {
legend: {
display: false
}
}
}
});

image

I am using ChartJs version 3.5.1
and word cloud version 3
Thanks

@syed-asim syed-asim added the bug Something isn't working label Dec 13, 2021
@syed-asim
Copy link
Author

syed-asim commented Dec 13, 2021

I found a solution, reason for the issue was "Data labels plugin". I disabled the DataLabels plugin and the issue was resolved!
Here is fix for anyone facing the same issue.

const chart = new Chart(document.getElementById(visual.VisualId).getContext("2d"), {
        type: "wordCloud",
        data: {
            labels: words2.map((d) => d.key),
            datasets: [
                {
                    label: "",
                    data: words2.map((d) => d.value)
                }
            ]
        },
        options: {
            color: ThemeCols[0].toString(),
            fit: true,
            padding: 2,
            title: {
                display: false,
            },
            plugins: {
               datalabels: {
                    display: false,
                },
                legend: {
                    display: false
                }
            }
        }
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant