Android Question Chart

ykucuk

Well-Known Member
Licensed User
Longtime User
Hello,

I need to add many mini charts into customlistview.

My problem is any of chart library doesn't support work with 20%x and 10%y sizes.

How can i add chart to my project with small size

I don't need Labels, Numbers for the show.

Please check attached file.

Any help?
 

Attachments

  • Screen Shot 2017-11-09 at 18.13.12.png
    Screen Shot 2017-11-09 at 18.13.12.png
    5.2 KB · Views: 189

ykucuk

Well-Known Member
Licensed User
Longtime User
It is quite simple to create this pattern with Canvas or B4XCanvas. Create a Path with the points and fill it. Then draw the thick lines.
Thank you for information. Could you tell me how i should start. i never work with canvas. Any tutorial for draw path and paint ?
 
Upvote 0

ykucuk

Well-Known Member
Licensed User
Longtime User
Just type CANVAS on the Search box above and browse the results.

I never send post before search in the forum. There are many canvas examples but they are like make bitmap round or something like that.

That's why i asked. I need draw line path and paint that area
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
I never send post before search in the forum. There are many canvas examples but they are like make bitmap round or something like that.

That's why i asked. I need draw line path and paint that area
If you are searching for the EXACT solution then, good luck, the point is that you LEARN how to use the canvas, the examples will show you that.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
How can i add chart to my project with small size
Snap005.png



B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private sv1 As SparkView
    Private sv2 As SparkView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Layout1")
 
    sv1.FillType = sv1.FT_NONE
    sv1.Data = Array As Float(15,16.5,16.70,17,15,15,15)
 
    sv2.FillType = sv2.FT_DOWN
    sv2.Data = Array As Float(0,17,36,52,85,115,135,140,100,130,130)
 

End Sub




It is the one with the FILL (lower left)


WhatsApp Image 2017-11-11 at 10.07.55.jpeg


Please click here to donate for my work to write the wrapper for you (You can donate any amount you want :))


You need the Library attached.
 

Attachments

  • SparkEx.zip
    7.9 KB · Views: 168
  • SparkV1.0.zip
    22.1 KB · Views: 176
Last edited:
Upvote 0

wonder

Expert
Licensed User
Longtime User
My problem is any of chart library doesn't support work with 20%x and 10%y sizes.

Simple math:
B4X:
Sub PercentX(value As Double) As Double
    Return value * 100%x
End Sub

Sub PercentY(value As Double) As Double
    Return value * 100%y
End Sub

'34%x = PercentX(0.34)
'98%y = PercentY(0.98)
 
Upvote 0

ykucuk

Well-Known Member
Licensed User
Longtime User
Snap005.png



B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private sv1 As SparkView
    Private sv2 As SparkView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Layout1")

    sv1.FillType = sv1.FT_NONE
    sv1.Data = Array As Float(15,16.5,16.70,17,15,15,15)

    sv2.FillType = sv2.FT_DOWN
    sv2.Data = Array As Float(0,17,36,52,85,115,135,140,100,130,130)


End Sub




It is the one with the FILL (lower left)


View attachment 61550

Please click here to donate for my work to write the wrapper for you (You can donate any amount you want :))


You need the Library attached.

Thank you so much.
I ll donate asap
 
Upvote 0
Top