Android Question need RX&TX linechart in scroll view.can you help me?

hears

Active Member
Licensed User
Longtime User
i have try many line chart,they cannot work with scroll view maybe.or my code have wrong...here is my project design picture.i need find line chart for this project now,witch line chart can display network RX&TX data?do you have any advice?


Intstats.jpg


Screenshot_20181217-155618_CustomScrollView.png

Screenshot_20181217-195052_CustomScrollView.png
 
Last edited:

hears

Active Member
Licensed User
Longtime User
xcharts work with scroll view perfect,
if screen very small,i have problem with font and chart border size,is it possible to disable the words around chart?or change it to small font.
Screenshot_20181219-234456_B4A Example.png
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I am convinced that xChart is not the best tool to display so small charts!
If I had to display this kind of charts, I would write a specific code for this, with probably less than 50 lines of code.
The xChart code module has more than 2500 lines of code!
Then, I have one question: what is the purpose of such small charts without any scale?
 
Last edited:
Upvote 0

hears

Active Member
Licensed User
Longtime User
I am convinced that xChart is not the best tool to display so small charts!
If I had to display this kind of charts, I would write a specific code for this, with propbably less than 50 lines of code.
The xChart code module has more than 2500 lines of code!
Then, I have one question: what is the purpose of such small charts without any scale?
small led will display switch working state
Screenshot_20181217-195052_CustomScrollView.png
 
Upvote 0

hears

Active Member
Licensed User
Longtime User
Do you have an example of data for the chart?

B4X:
 Dim Y As Int
    Y =Rnd(0,100)
    Dim X As Int
    X=DateTime
'Y data is internet real time speed,
'X data is time

i have try change under chart project,but not success now.
i guess my data not fit this chart,need a little change.
after input the Data to "sub DrawCurves" ,in "roll" modern .

but i do not know how to change,this code is importent for draw line by X & Y :

B4X:
cvsGraph.DrawLine( x - dx, yy1(i), x, yy2(i), Curve(i).Color, Curve(i).Width)
 

Attachments

  • Oscilloscope_V_1_4.zip
    8.4 KB · Views: 177
Upvote 0

klaus

Expert
Licensed User
Longtime User
Are you now trying to use the Oscilloscope project?
I give you the same answer, not the best tool to display so small charts!

I asked you for an example of data, but unfortunately you didn't answer my question.

For me, the best way to solve your problem is to write a specific CustomView to display your data.
Could you give some more information.
What exactly do you want to display in the chart?
What data? (internet real time speed and time)?
What value range (min, max)?
How many values?
What update frequency?
With scales?

Depending on the answers to the questions above the CustomView code would be more or less complicated.

You may have a look at the B4X Graphics Booklet chapter 3 Graphs it includes the source code.
This example could be simplfied and modified to make a CustomView depending on what you need.
 
Upvote 0

hears

Active Member
Licensed User
Longtime User
Are you now trying to use the Oscilloscope project?
I give you the same answer, not the best tool to display so small charts!

I asked you for an example of data, but unfortunately you didn't answer my question.

For me, the best way to solve your problem is to write a specific CustomView to display your data.
Could you give some more information.
What exactly do you want to display in the chart?
What data? (internet real time speed and time)?
What value range (min, max)?
How many values?
What update frequency?
With scales?

Depending on the answers to the questions above the CustomView code would be more or less complicated.

You may have a look at the B4X Graphics Booklet chapter 3 Graphs it includes the source code.
This example could be simplfied and modified to make a CustomView depending on what you need.



thanks for your reply.

the X data is time,so always rise, range is from 120 second ago to now.
the Y data is in a range(0%,100%).
frequency is every 2 second get Y data ,and draw to the chart.
have scale .in X direct.
a little same to the under picture.

connect_wk_0401.gif
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Well, the example above is different from the example in post#1 adding some confusion.
You want scale indications on so small charts?
What size of the charts do you think of?
How many charts do you at the same time, like in post #1?
 
Upvote 0

hears

Active Member
Licensed User
Longtime User
Well, the example above is different from the example in post#1 adding some confusion.
You want scale indications on so small charts?
What size of the charts do you think of?
How many charts do you at the same time, like in post #1?

scale or move only in x direct.
size can a little big or longer,
on screen have 5 chart is ok.
 
Upvote 0
Top