RadCartesianChart crashes on Android with demo code > java.util.IllegalFormatConversionException: f != java.lang.String
justintoth opened this issue ยท 0 comments
justintoth commented
Environment
- CLI: 8.0.1
- Cross-platform modules: nativescript-ui-chart
- Android Runtime: Android 10, API 29
- iOS Runtime: 12.4.0
- NativeScript-Angular: 11.0.1
- Angular: 11.1.2
Describe the bug
When trying to implement a RadCartesianChart, even using the demo code (https://play.nativescript.org/?template=play-ng&id=8zpRGL&v=4), it errors.
System.err: An uncaught Exception occurred on "main" thread.
System.err: f != java.lang.String
System.err:
System.err: StackTrace:
System.err: java.util.IllegalFormatConversionException: f != java.lang.String
System.err: at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4403)
System.err: at java.util.Formatter$FormatSpecifier.printFloat(Formatter.java:2898)
System.err: at java.util.Formatter$FormatSpecifier.print(Formatter.java:2845)
System.err: at java.util.Formatter.format(Formatter.java:2524)
System.err: at java.util.Formatter.format(Formatter.java:2459)
System.err: at java.lang.String.format(String.java:2870)
System.err: at com.telerik.widget.chart.engine.axes.categorical.CategoricalAxisModel.getLabelContentCore(CategoricalAxisModel.java:248)
...
To Reproduce
Add the following into a component.tns.html view:
<RadPieChart class="chart" allowAnimation="true" row="0">
<PieSeries tkPieSeries
selectionMode="DataPoint"
expandRadius="0.4"
outerRadiusFactor="0.7"
valueProperty="amount"
legendLabel="type"
[items]="expensesSource">
</PieSeries>
<RadLegendView tkPieLegend position="Right" offsetOrigin="TopRight" width="90" enableSelection="true"></RadLegendView>
</RadPieChart>
Add the following into a component.ts file:
public favoriteFruits = [
{ type: "๐", count: 7 },
{ type: "๐", count: 15 },
{ type: "๐", count: 12 },
{ type: "๐", count: 30 },
{ type: "๐", count: 16 }
];
Expected behavior
It should display the chart like iOS does, instead of crashing the app.