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

klaus

Expert
Licensed User
Longtime User
The xChart class and library has been updated to version 8.0 in the first post.
Amended graph height when no x scale nor x axis name.
Added display of a YXChart line with only one point value with logarithmic scales.
 

behnam_tr

Active Member
Licensed User
Longtime User

Which function controls this part ??
I mean display the data panel after clickDown on the Barchart
i need to change Orientetion
 

klaus

Expert
Licensed User
Longtime User
This is managed in the InitValues and DisplayItemValues routines.
The InitValues routine draws the text, which is drawn once when the chart is initialized.
The DisplayItemValues routine draws the values when the cursor is moved.
The position after the = sign is the defined in the Values.Midpoint varaiable.
To take into account right to left texts these routines must be adapted.
 

behnam_tr

Active Member
Licensed User
Longtime User
thanks ,solved with your help
what is the limit of bars in bar chart?
i have 600row and cant load all of them
 

Cliff McKibbin

Member
Licensed User
Klaus, I am using your stackedbarchart and love it. Great job.

I found that if I pushed the x-axis out past 47 bars (years in my case), I got the "Bar width = too small !!! Drawing of Bar chart skipped" log message and the chart disappeared.

My first solution was to hold the x-axis to 47 bars. However, when I did that and I increased the values in the y-axis to a certain point, I again got the same error and the chart disappeared. When I held the chart to 45 bars, I could increase the y-axis value indefinitely.

The forum entry just above said the number of bars was limited by the size of the chart. It may be that on a tablet, I could extend the number of bars.

The method suggested above "GetMaxNumberBars" does not work prior to the '.Drawchart' but I will experiment with drawing the chart, checking the maxbars and then redrawing if I have too many bars so it displays properly. That might be the proper approach.

Thanks, Cliff
 
Last edited:

klaus

Expert
Licensed User
Longtime User
The method suggested above "GetMaxNumberBars" does not work prior to the '.Drawchart'
Did you fill the data before calling GetMaxNumberBars ?
To get a concrete answer, you need to set the data before calling GetMaxNumberBars.
 

Alessandro71

Well-Known Member
Licensed User
Longtime User
Is it possible to have a transparent chart background?
I tried setting ChartBackgroundColor to xui.ColorTransparent, with no success on B4A
 

klaus

Expert
Licensed User
Longtime User
Sure !
I just tested PieChart1.ChartBackgroundColor = xui.Color_Transparent in the demo project with B4J and it works as expected.
Where and when did you add the xxx.ChartBackgroundColor = xui.Color_Transparent instruction ?
You can also set it in the Designer, I retested it.
 

klaus

Expert
Licensed User
Longtime User
The xChart class and library has been updated to version 8.1 in the first post.
Added a HideLine method allowing to not display a line.
Added SetYScaleNMinValue, GetYScaleNMinValue, SetYScaleNMaxValue and GetYScaleNMaxValue methods.
Amended problem with DrawLinesNScales and zoom
Amended some minor problems.
 

Alessandro71

Well-Known Member
Licensed User
Longtime User
[Wish]
When DifferentScales = True, have a Y2AxisName property to set a right side label, just like charts in Google Sheets
 

Alessandro71

Well-Known Member
Licensed User
Longtime User
Sure, i wasn't downplaying the effort; just to say a single line of text would be sufficient even with 4 scales: it's just an axis name, not a scale name
 

klaus

Expert
Licensed User
Longtime User
Cookies are required to use this site. You must accept them to continue using the site. Learn more…