feat: legend show be hidden for the graph with no data (#3168)

Co-authored-by: gitstart <gitstart@users.noreply.github.com>
Co-authored-by: Nitesh Singh <nitesh.singh@gitstart.dev>
Co-authored-by: RubensRafael <rubensrafael2@live.com>
Co-authored-by: Rubens Rafael <70234898+RubensRafael@users.noreply.github.com>
This commit is contained in:
GitStart 2023-07-18 13:07:27 +03:00 committed by GitHub
parent b3a6deb71b
commit 0de40a889d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -288,12 +288,11 @@ function Graph({
if (chartHasData) {
chartPlugins.push(createIntersectionCursorPlugin());
chartPlugins.push(createDragSelectPlugin());
chartPlugins.push(legend(name, data.datasets.length > 3));
} else {
chartPlugins.push(emptyGraph);
}
chartPlugins.push(legend(name, data.datasets.length > 3));
lineChartRef.current = new Chart(chartRef.current, {
type,
data,