B4J Question [xchart] info panel position Problem

behnam_tr

Active Member
Licensed User
Longtime User
hello....

i have problem with info panel

Not ok after load form and before horzintal scrolling

1.png


its ok after horzintal scrolling to the left

2.png



in this Private Sub InitValues
Log(Graph.Top)

Waiting for debugger to connect...
Program started.
0 ''' before scroll
xChart BarValueOrientation set to VERTICAL
49 ''' after scroll
xChart BarValueOrientation set to VERTICAL
 

Attachments

  • ChartsDemo1.zip
    43.5 KB · Views: 130
Last edited:

behnam_tr

Active Member
Licensed User
Longtime User
My problem was temporarily solved with the following settings
But it is difficult when the number of data is less and there is no scroll bar

:(
B4X:
BarChart1.JumpTo(0)  ' After BarChart1.DrawChart
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I tested the project in post #1 and it works as expected on my computer.
Some comments:
1. All indexes begin with 0 and not with 1.
Therefore you could use BarChart1.SetZoomIndexes(0, 3) instead of BarChart1.SetZoomIndexes(1, 4).

2. In your example, do you really need the zoom? Zoom is not mandatory.

3. All the properties you define in the code could be set directly in the Designer.
In the demo program from the xChart thread, I set properties in the code for testing, to make sure that this works.
Like in the attached modified version.

4. You may set the BarValueOrientation property with BarChart1.BarValueOrientation = "VERTICAL" to avoid this log: xChart BarValueOrientation set to VERTICAL
 

Attachments

  • ChartsDemo2.zip
    43.1 KB · Views: 116
Upvote 0

behnam_tr

Active Member
Licensed User
Longtime User
I tested the project in post #1 and it works as expected on my computer.
Some comments:
1. All indexes begin with 0 and not with 1.
Therefore you could use BarChart1.SetZoomIndexes(0, 3) instead of BarChart1.SetZoomIndexes(1, 4).

2. In your example, do you really need the zoom? Zoom is not mandatory.

3. All the properties you define in the code could be set directly in the Designer.
In the demo program from the xChart thread, I set properties in the code for testing, to make sure that this works.
Like in the attached modified version.

4. You may set the BarValueOrientation property with BarChart1.BarValueOrientation = "VERTICAL" to avoid this log: xChart BarValueOrientation set to VERTICAL

ok thanks
why graph.top=0 after first load?
but when i scroll to left or change form width it become 49
 
Upvote 0
Top