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

[Bug]: JS functions for ChartDataLabels are not compiled #5836

Open
daywee opened this issue Nov 11, 2024 · 0 comments
Open

[Bug]: JS functions for ChartDataLabels are not compiled #5836

daywee opened this issue Nov 11, 2024 · 0 comments
Labels
Type: Bug 🐞 Something isn't working

Comments

@daywee
Copy link

daywee commented Nov 11, 2024

Blazorise Version

1.6.2

What Blazorise provider are you running on?

None

Link to minimal reproduction or a simple code snippet

Don't have

Steps to reproduce & bug description

  1. Setup pie chart and labels with any data
<PieChart TItem="int" Options="_pieChartOptions" Data="_data">
    <ChartDataLabels TItem="int" Options="_barDataLabelsOptions"  />
</PieChart>
  1. Setup options and dataset options
    private List<ChartDataLabelsDataset> _barDataLabelsDatasets = new()
    {
        new()
        {
            DatasetIndex = 0,
            Options = new()
            {
                Display = new ScriptableOptions<object, ScriptableOptionsContext>(ctx => ctx.DataIndex % 2 == 0),
            },
        },
    };

    private ChartDataLabelsOptions _barDataLabelsOptions = new()
    {
        Display = new ScriptableOptions<object, ScriptableOptionsContext>(ctx => ctx.DataIndex % 2 == 0),
    };

What is expected?

Only labels for even data indexes should be displayed.

What is actually happening?

All labels are displayed.

What browsers do you see the problem on?

Chrome

Any additional comments?

If you use Datasets="_barDataLabelsDatasets" then the scriptable function works correctly. I think the reason why it doesn't work is that in case of using Options property, the functions are not compiled as they are in the case of Datasets property. See

compileDatasetsOptionsCallbacks(dataset.options);

@daywee daywee added the Type: Bug 🐞 Something isn't working label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant