B4A Library MPAndroidCharts - Various type of graphs / charts (Latest library V1.22 in post #1)

Johan Schoeman

Expert
Licensed User
Longtime User
Dear Johan,

How can I completely disable/hide the marker view when using the multiLineChart?

Thanks and best regards,
Kevin
Will have to amend the library to do so. Will try to get to it sometime this week.

JS
 

Johan Schoeman

Expert
Licensed User
Longtime User
Will have to amend the library to do so. Will try to get to it sometime this week.

JS
Here you go - lib files attached. It should show as V1.13 in the B4A IDE libs tab

Just set the marker to use to 0

B4X:
mlc1.MarkerToUse = 0

I suggest you leave the files in the /Objects/res/layout and Objects/res/drawable folder. They are however not required to be there when MarkerToUse is set to 0 but when setting MarkerToUse to any other value they MUST be there.

I have applied this change to all the graph types in the library.

JS
 

Attachments

  • mpChartLibV1.13.zip
    363 KB · Views: 493

Johan Schoeman

Expert
Licensed User
Longtime User

Johan Schoeman

Expert
Licensed User
Longtime User
It’s a pity! If you have it, it's great.
Will you try it?
Attached is the Java code. You are welcome to give it a try.
 

Attachments

  • TheJavaCode.zip
    294.8 KB · Views: 363

jtare

Active Member
Licensed User
Longtime User
Unfortunately not as the library stands at present unless you superimpose two charts on top of one another with transparency in the right places.
Is there any solution to this? Searching I found that there is a way to combine charts, but there is only the same example of bar charts and lines charts, not candlestick and lines or candlesticks and points.
Thanks.

Seems possible: https://github.com/PhilJay/MPAndroi...per/mpchartexample/CombinedChartActivity.java

EDIT:
I got it to work. I edited the source code from the combine bar chart and line chart. Now I can draw a candlestick chart and a line chart. Now I will try candlestick+multiline+multibubble+multiscatter.
 
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
Hi everybody, Is there any way to set the color of crosshair cursor lines ?
Thanks !
Have not looked at the lib in a very long time but from memory it takes the color of the line/chart that you have clicked on. This lib is probably outdated and someone can perhaps try and wrap the latest version of this Github project and in all probability do it far better than what I have done. Done this in my early days of trying to do wrappers.
 

loonet

Member
Licensed User
Thanks, its outdated but anyway usefull. Thanks for your reply
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi everybody, Is there any way to set the color of crosshair cursor lines ?
Thanks !

Use the attached lib files (copy them to your additional libs folder. Have added the ability to set the color and the width of the cross hair to multilinecharts, radarcharts, and linecharts (single) for now.

Lib should show as V1.14

Example code from multilinechart:
B4X:
    mlc1.HighlightLineWidth = 2.0f
    mlc1.CrossHairColor = Array As Int(Colors.White, Colors.Yellow, Colors.White, Colors.Yellow, Colors.White, Colors.Yellow, Colors.White, Colors.Yellow, Colors.White, Colors.Yellow)
    
    mlc1.setLineData(10,37)

I need to do some method naming changes in the library at some time or another...
 

Attachments

  • mpChartLib.xml
    385.4 KB · Views: 381
  • mpChartLib.jar
    359 KB · Views: 391

loonet

Member
Licensed User
Thanks so much Johan ! I really appreciate the favor you gave me
 

mico

Member
Licensed User
Longtime User
Hi Johan,

Thank you for this great library. I am stuck at getting values from a listview, can you help?

I have two listviews, one for x's and the other for y's. I can succesfully add items and log the values they took with this code:
B4X:
For i=0 To x_list.Size-1 Step 1
m=x_list.GetItem(i)
Log(m)
Next

For j=0 To y_list.Size-1 Step 1
n=y_list.GetItem(j)
Log(n)
Next

But I cannot define these values as x labels and y values in the multiline chart. Is there a way to do it? How can I transfer my "x" values in
B4X:
chart.XaxisLables = Array As String()
and "y" values in
B4X:
chart.Chart_1_Data= Array As Float()
using my values from the related listviews.

Thanks for any help.

 
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
Solved in the PM that you have sent me.
 

wimpie3

Well-Known Member
Licensed User
Longtime User
@Johan Schoeman It seems the value of the data point is ALWAYS shown when you click on a data point. I thought I could disable that behavior by passing FALSE to DrawGraphValues, but that only disables the INITIAL showing of the data value. When you touch a data point on the graph, the value is shown no matter what DrawGraphValues is set to.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…