Android Question xChart using transparent addline and Legend/Touch info enabled

Frank.G

Member
Licensed User
Longtime User
Dear all,

I am using the xchart.b4xlib from Klaus https://www.b4x.com/android/forum/threads/b4x-xui-xchart-class-and-b4xlib.91830/#content
First, a big thank you to Klaus , great lib 👍

My problem, wish is to modify the colors of the text and the values when either enabling the graph legend or using the touch info event and viewing the labels and the values.
I needed transparent lines for the chart to create the view I wanted.

Screenshot_2.jpg




code for lines:
'nur Line'
chart_labor.AddLine("Verlauf", MainColor)
' Serie 1: Nur gute Punkte (Linienfarbe = Transparent, Dicke = 0)
chart_labor.AddLine2("Normal", xui.Color_ARGB(0, 255, 255, 255), 0, "CIRCLE", True, MainColor)
' Serie 2: Nur schlechte Punkte (Linienfarbe = Transparent, Dicke = 0)
chart_labor.AddLine2("Alarm", xui.Color_ARGB(0, 255, 255, 255), 0, "CIRCLE", True, AlertColor)

This code draws three lines above each other:
One green line for the graph without bullets
One green line with the bullets only, using transparent lines
One red line with the bullets only, using transparent lines.

It works like charm with one disadvantage, touching the screen or enabling the legend shows the values ok in black, but the lbl txt before the values is blank because the lines are transparent.
Is there a way to color the lbl different is there a feature planned in the xChart lib to make this possible?


Thx in advance
 

Frank.G

Member
Licensed User
Longtime User
For now this is not possible as its part of a large codebase of an APP I am developing.
Basically the following happens:

  • A database supplies hundreds of value including upper/lower tolerance ranges
  • They are shown in a list
  • When I click on a parameter the graph is loaded
  • While generating the graph the colors and the bullets are set as I described above
  • as there are sometimes many parameters loaded there are no values beside the bullets shown. The user can touch the graph and the popup info shows the value and the upper lower.
  • Everything is there except the label text alert or normal, beside the value shown when touched, as they are written transparent.

No worries, I will see what I can do as a workaround. Maybe direct access of the java object etc. I am not that good and it takes me some in depth learning.

Thanks for the response anyways.
 
Upvote 0
Top