pepstock-org / Charba

J2CL and GWT Charts library based on CHART.JS
https://pepstock-org.github.io/Charba-Wiki/docs
Apache License 2.0
62 stars 6 forks source link

setBorderColor causing error in IE11 #34

Closed FrankW76 closed 5 years ago

FrankW76 commented 5 years ago

dataset.setBorderColor(borderColors.toArray(new String[0]));

Works fine on all browsers except IE11 gives an error :

Unknown.Crx_g$(ArrayString.java:63) Unknown.bKx_g$(HovingDataset.java:340)

When removing the setBorderColor line the graph work without any problem

stockiNail commented 5 years ago

@FrankW76 I've tested right now on IE11.

Here my code:

PieDataset dataset = chart.newDataset();
dataset.setBorderWidth(5,5,5,5,5,5,5);
List<String> list = Arrays.asList(Colors.ALL[8].toRGBA(), Colors.ALL[5].toRGBA(),Colors.ALL[13].toRGBA(),Colors.ALL[15].toRGBA(),Colors.ALL[1].toRGBA(),Colors.ALL[0].toRGBA(),Colors.ALL[19].toRGBA());
dataset.setBorderColor(list.toArray(new String[0]));

Here the result:

IE11Border

I have checked also the code of the error you got it and sounds really strange because is the native object.

May I ask you which chart type you are using (I assumed Pie or Doughnut)?

FrankW76 commented 5 years ago

Noted that also setBorderWidth does not work for me.

ResourcesType.setClientBundle(EmbeddedResources.INSTANCE);

DoughnutChart chart = new DoughnutChart(); chart.getCanvas().getElement().getStyle().setOutlineStyle(Style.OutlineStyle.NONE);

DoughnutDataset dataset = new DoughnutDataset(); dataset.setBorderWidth(5,5,5,5,5,5,5);

This gives an error

(TypeError) : Kan de eigenschap apply van een niet-gedefinieerde verwijzing of een verwijzing naar een lege waarde niet ophalen

Unknown.zox_g$(ArrayInteger.java:61) Unknown.fKx_g$(HovingDataset.java:412) Unknown.kZi_g$(BalanceTileBox.java:152)

With BalanceTileBox.java:152 being the setBorderWidth line.

stockiNail commented 5 years ago

I've added also the style of canvas you are using and it works fine.

I know it sounds a strange request but could you recompile your GWT application?

stockiNail commented 5 years ago

I found that Array javascript object has got a method Array.from and in Charba implementation we created a overlay method on Array object with the same name but different signature and not native.

I have the feeling that could create some conflicts (between polyfill and how JSINTEROP acts overlaying methods, I'm still investigating) therefore we have changed the name of Charba method and committed.

Unfortunately I'm not able to reproduce the issue because, as wrote above, I don't get that error.