LightningWebChartJS icon indicating copy to clipboard operation
LightningWebChartJS copied to clipboard

Apex Custom Data Provider background colour not displayed

Open eclarke12 opened this issue 3 years ago • 1 comments

Who is the bug affecting?

Developer (me) currently

What is affected by this bug?

Custom background colours defined in Apex Custom Data Provider don't show up on doughnut chart

When does this occur?

On loading chart

Where on the platform does it happen?

Chart component from Managed Package

How do we replicate the issue?

Set a custom background colour property in the Custom Data Provider

Expected behavior (i.e. solution)

Custom background colours should be shown

Other Comments

I see this error in console: image

aura_proddebug.js:61421 WARNING: SecureElement: [object HTMLStyleElement]{ key: {"namespace":"lwcc"} } does not allow setting the type attribute, ignoring!

possibly the method for injecting the style is no longer allowed?

Additionally I would like to use an array for this property but I'm not sure the syntax.

Here's my example code:

global inherited sharing class MyCustomChartDataProvider extends lwcc.ChartDataProvider {
  public override void init(Object initParameter) {}
  
  public override List<lwcc.ChartDataProvider.ChartData> getData() {
    List<lwcc.ChartDataProvider.ChartData> chartDataList = new List<lwcc.ChartDataProvider.ChartData>();
    lwcc.ChartDataProvider.ChartData data = new lwcc.ChartDataProvider.ChartData();
    data.detail = [95.0, 5.0];
    data.labels = ['Label 1','Label 2'];
    data.bgColor = '["rgb(100,100,100)","rgb(200,200,200)"]';
    chartDataList.add(data);
    return chartDataList;
  }
}

eclarke12 avatar Jul 19 '22 17:07 eclarke12

Hello, we do not continue to apply fixes to this project, but we only act as code reviewers and release managers. You're welcome to create a Pull Request with your suggested changes, that we'll review. If approved, the Pull Request will be included in the open-source (repository) version of the package. However, new changes won't be part of the Managed Package. Hope it's clear and you understand it. Happy to see your PRs coming in the future. Best regards, @scolladon & @victorgz

victorgz avatar Dec 13 '24 08:12 victorgz