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

Peter Simpson

Expert
Licensed User
Longtime User
Phew...
1. You didn't miss anything!
Thank you.

I also replaced the code on line 1122 with as well as line 1114 with the following line, line 1122 moved the zero above the x line.
B4X:
If h >= 0 Then

I've also added
B4X:
If Values.Show = False Then Return

to the following sub directly under 'Case 0'
B4X:
Private Sub xCursor_Touch (Action As Int, X As Float, Y As Float)
    Select Action
        Case 0    'DOWN
            If Values.Show = False Then Return
            If X > Graph.Left And X < Graph.Right And Y > Graph.Top And Y < Graph.Bottom Then

Otherwise it leaves x = and y = legend with no values whatsoever.

Thank you...
 
Last edited:

Peter Simpson

Expert
Licensed User
Longtime User
Request/Feature: How about having an optional horizontal Mean/Average line in the future on the bar charts. I don't actually need this feature, but it would be a nice touch to have...
 

Peter Simpson

Expert
Licensed User
Longtime User
Nice update and thank you @klaus,
I'd already implemented the fixes that you suggested, but the added features you have added will undoubtedly come in handy for others and myself.

Anyway I've just tested it the updated Xchart custom view class, there is a typo in the xcharts comments (nothing important), cgarts should say charts.

Basically the .IncludeBarMeanLine is turning On/Off the bar values the exact same way as .IncludeValues does.

Issue: Even though I'm not going to use the feature, I can't get the following working lines to do anything. The IncludeBarMeanLine works fine if set in the designer, but not in code modules.
B4X:
.IncludeBarMeanLine = True
or
B4X:
.IncludeBarMeanLine = False

Anybody developers that are updating this XUI Class into their projects needs to re-save the layout file in the designer.

Enjoy...
 

Mark Read

Well-Known Member
Licensed User
Longtime User
Sorry to be a pain but..

I have downloaded xChart V1-7 and wanted to have a look at it with B4J 6.30. I have an error "unknown member: fillradialgradient" on line 1530

B4X:
bc1.FillRadialGradient(Array As Int(Acol, Item.Color), rb)
in the module xChart.bas.

Have i missed something?
 

Mark Read

Well-Known Member
Licensed User
Longtime User
Thank you.
 

Mark Read

Well-Known Member
Licensed User
Longtime User
I have checked all the libraries: BitmapCreator 3.2, jXUI 1.70. The IDE shows no errors but when I compile I get the error:

B4X:
Cannot find: C:\Program Files (x86)\Anywhere Software\B4J\libraries\xui.jar

So I copied the two XUI files from my B4A internal library to B4J and now I have a compile error:

B4X:
B4J Version: 6.30
Parsing code.    (0.07s)
Compiling code.    (0.17s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
Compiling generated Java code.    Error
B4J line: 1280
bmc1.FillGradient(Array As Int(Cols(j), ACol
javac 1.8.0_171
src\b4j\ChartsDemo\xchart.java:2542: error: incompatible types: anywheresoftware.b4j.objects.B4XCanvas.B4XRect cannot be converted to anywheresoftware.b4a.objects.B4XCanvas.B4XRect
_bmc1._fillgradient(new int[]{_cols[_j],_acols[_j]},(anywheresoftware.b4a.objects.B4XCanvas.B4XRect)(_rb),"TOP_BOTTOM");
                                                                                                    ^
1 error

I would really like to see this demo. Am I the only one who is struggling?

Please advise. Many thanks.
 

rboeck

Well-Known Member
Licensed User
Longtime User
I think, that XUI is a internal library now; in my internal libraries folder i see jXUI.xml and jXui.jar. So remove the xui from B4A and use the internal jXUI (1.70) from B4J; maybe you dont use the last version - my testing was made with B4J v. 6.30.
 

Mark Read

Well-Known Member
Licensed User
Longtime User
I have B4J 6.30 which contains, internally, jXUI version 1.70, BitmapCreator Ver. 3.50. Opening the ChartsDemo.b4j in Notepad++, I see:

B4X:
AppType=JavaFX
Build1=Default,b4j.ChartsDemo
File1=Main.bjl
FileGroup1=Default Group
Group=Default Group
Library1=jcore
Library2=jfx
Library3=jxui
Library4=javaobject
Library5=bitmapcreator
Module1=xChart
NumberOfFiles=1
NumberOfLibraries=5
NumberOfModules=1
Version=6.3

This is my IDE



There is no mention of XUI!
 

Mark Read

Well-Known Member
Licensed User
Longtime User
This is what happens when I compile. Notice no error in log, no red markers in the slider, nothing!

 

klaus

Expert
Licensed User
Longtime User
It looks strange to me that the progam is looking for xui.jar, the correct file is jxui.jar!
These are the two library files I have in the B4J program Library folder:
 

Attachments

  • jXUI.jar
    44 KB · Views: 535
  • jXUI.xml
    53.3 KB · Views: 622

Mark Read

Well-Known Member
Licensed User
Longtime User
I have renamed my two jXUI files and copied your two to the internal directory. Closed everything and restarted B4J, the result is the same as in post 74.

I have idea where the reference to xui.jar is????
 

Mark Read

Well-Known Member
Licensed User
Longtime User
I have just noticed this:



The path to my B4J is C:\Programme (x86)..... and the path in the error message is different!

Just for info, I am running Win 7 Pro 64 bit in german.
 

klaus

Expert
Licensed User
Longtime User
Did you copy the two files in the Library folder of the B4J program.
Make sure that you dont have any xui.jar file in the B4J additional library folder.
Which files do you see in the IDE Libraries Manager Tab?
Do you have any modules in the IDE apart of xChart?

 

Mark Read

Well-Known Member
Licensed User
Longtime User

Mark Read

Well-Known Member
Licensed User
Longtime User
Klaus, es tut mir Leid. Ich habe's. I have the BitmapCreator library NOT the jBitmapCreator - ich bin doch blöd!!

Jetzt hat's funktioniert - schaut toll aus. Like kommt auch.

Danke.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…