B4J Question [xChart] Font and textDirection problem

behnam_tr

Active Member
Licensed User
Longtime User
hi
xchart.png


i have three problem with xchart

1 - how set or change defualt dont for title and subtitle and X,Yaxis name??
2 - According to the picture, Persian letters are scattered in the upper left corner,How fix ??
3 - After Refresh data and load again,scroll bar goes the right and when i click empty space i get this error
**In the case of the above problem, if I scroll to the left and scroll to the right again, there is no problem and the empty space is removed.
xChart BarValueOrientation set to VERTICAL
xChart BarValueOrientation set to VERTICAL
xChart BarValueOrientation set to VERTICAL
xChart BarValueOrientation set to VERTICAL
xChart BarValueOrientation set to VERTICAL
xchart._drawitemvalues (java line: 5323)
java.lang.IndexOutOfBoundsException: Index: 10, Size: 10
at java.util.ArrayList.rangeCheck(ArrayList.java:657)
at java.util.ArrayList.get(ArrayList.java:433)
at anywheresoftware.b4a.objects.collections.List.Get(List.java:122)
at b4j.ChartsDemo.xchart._drawitemvalues(xchart.java:5323)
at b4j.ChartsDemo.xchart._xpnlcursor_touch(xchart.java:12117)
at sun.reflect.GeneratedMethodAccessor6.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:108)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
at anywheresoftware.b4j.objects.PaneWrapper$2.handle(PaneWrapper.java:129)
at anywheresoftware.b4j.objects.PaneWrapper$2.handle(PaneWrapper.java:1)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3757)
at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:394)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:432)
at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:410)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:431)
at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
at com.sun.glass.ui.View.notifyMouse(View.java:937)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:186)
at java.lang.Thread.run(Thread.java:748)

thanks.
 

klaus

Expert
Licensed User
Longtime User
1. Currently there is no option to change the font of the texts.
2 I suppose you are speaking of this:

1627816196832.png


The problem is the right to left text. This not taken into account.

3. I need to look further for that.
How do you refresh and recall the chart.
Could you post a small project as a zip file showing this problem.
 
Last edited:
Upvote 0

behnam_tr

Active Member
Licensed User
Longtime User
1. Currently there is no option to change the font of the texts.
2 I suppose you are speaking of this:

View attachment 117300

The problem is the left to right text. This not taken into account.

3. I need to look further for that.
How do you refresh and recall the chart.
Could you post a small project as a zip file showing this problem.

attached sample
 

Attachments

  • test.zip
    43.4 KB · Views: 134
Upvote 0

klaus

Expert
Licensed User
Longtime User
I had a look at your project.
The problem with the zoom is that in BarChart1.SetZoomIndexes(2, DataCount)
DataCount is heigher than the number max of points !
With BarChart1.SetZoomIndexes(2, DataCount - 1) it works as you expect it.
I added a check for values out of the limits.
Attached the modified version.
 

Attachments

  • ChartsDemo1.zip
    43.1 KB · Views: 126
Last edited:
Upvote 0
Top