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

RadCartesianChart crashes on Android with demo code > java.util.IllegalFormatConversionException: f != java.lang.String #2348

Open
justintoth opened this issue Apr 25, 2021 · 0 comments

Comments

@justintoth
Copy link

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.

Screen Shot 2021-04-25 at 3 57 07 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant