B4J Library [B4X] [XUI] xChart Class and b4xlib

Scantech

Well-Known Member
Licensed User
Longtime User
1.81899E-12 is not showing anymore. That is fixed .

But, Scale(sY).YZeroAxis = True is not fixed. I still see negative Y Text values. See attach. -50 and -100 are shown.
 

Scantech

Well-Known Member
Licensed User
Longtime User
Here you go.
Try both of them AddLinePointData and AddLineMultiplePoints at Sub DrawDynamicLinePoints
 

Attachments

  • xChartExample.zip
    31.4 KB · Views: 350

klaus

Expert
Licensed User
Longtime User
The xChart class has been updated to version 4.0 in the first post.
Amended the issues reported above, thank you Scantech.

I wish you had a donation button.
There will never be one. I do it because I have pleasure doing it.
 

Scantech

Well-Known Member
Licensed User
Longtime User
1 final issue. It looks like we did not test the opposite. Plug in Direction = Rnd(-100, -1) in my example. You will see Positive Y text with Scale(sY).YZeroAxis = True
 

klaus

Expert
Licensed User
Longtime User
The xChart class has been updated to version 4.2 in the first post.
Amended Draw MinLine with YZeroAxis.
Added PiePercentageNbFractions property

EDIT: You need to open and close the Designer to make the new property active.
 
Last edited:

universengo

Member
The xChart class has been updated to version 4.2 in the first post.
Amended Draw MinLine with YZeroAxis.
Added PiePercentageNbFractions property
Hello Klaus! I used your Xchart lib and found the error as
B4X:
Error occurred on line: 286
java.lang.NumberFormatException: For input string: "null"
    at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
    at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
    at java.lang.Double.parseDouble(Double.java:538)
    at anywheresoftware.b4a.debug.RDebugUtils.numberCast(RDebugUtils.java:48)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4j.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:62)
    at anywheresoftware.b4j.objects.LayoutBuilder.loadLayout(LayoutBuilder.java:93)
    at anywheresoftware.b4j.objects.PaneWrapper.LoadLayout(PaneWrapper.java:84)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:64)
    at b4j.example.thongkeslkt._show(thongkeslkt.java:69)
    at b4j.example.main._tkslkt_action(main.java:830)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA$1.run(BA.java:216)
    at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
    at java.lang.Thread.run(Thread.java:748)
Please help me, plz. Thanks.
 

universengo

Member
You need to open the Designer and close it, because I added a new property.
The Error was solved!
But I can't find PiePercentageNbFractions property in Designer.
How can I setup my data with PiePercentageNbFractions ?
Help me! Thanks.
 

Peter Simpson

Expert
Licensed User
Longtime User
Dear friends,
How to print the xChart snapshot using B4J?

What, to a printer???
You need to use jFXPrint.

Take a snapshot, send that snapshot of the chart and send it to jFXPrint as an image to an ImageView, jFXPrint can then print that ImageView to paper for you. You will have to manually set the ImageView size to print on. I use 730x480 to print on A4 sheets of paper.
 

rbghongade

Active Member
Licensed User
Longtime User
Thanks a lot!
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…