B4J Question [BANanoWebix] - How to implement multiple series on same chart

prbmjr

Active Member
Licensed User
Hi every one, I'm developing a webapp with BANanoWebix, but I'm quite stucked in chart implementation, how can I add multiple series in the same chart? I'm trying to implement a Spline chart, but I found only a setvalue propertie with a string parameter, can I use a map structure to define more than one serie? In the examples that I found there wasn't any with multiple series implementation... If any one can help , sending me a link with some examples or tell me the way to implement this I really appreciate that !

Thanks in advance!

Paulo Bueno
 

Mashiane

Expert
Licensed User
Longtime User
The examples you saw are perhaps based on this example, https://www.b4x.com/android/forum/threads/bananowebix-lesson-7-charts-part-1.106897/

I have just checked the Webix site, https://webix.com/widget/charts/ and noted that they do have multiple-series charts.

The source code for this library is available on https://github.com/Mashiane/BANanoWebix as I only did what I was able to do at the time for it and its easy to follow,

you will just have to implement whatever change you want on the WixChart. Most of the time you just set properties and webix does everything automatically for you.

For any additional support you can pm me.
 
Upvote 0

prbmjr

Active Member
Licensed User

Thank you for your quickly response, i will review your documentation and keep you posted with any news!

Regards!

Paulo Bueno
 
Upvote 0

prbmjr

Active Member
Licensed User
Thank you for your quickly response, i will review your documentation and keep you posted with any news!

Regards!

Paulo Bueno

SOLVED! I used the .SetAttr , already implemented in BANanowebix,, creating a new "Series" property used in Wix original js, like the code below:

B4X:
dim chTypeSpline As WixChart
Dim chartseries,legendvalue As List

chartseries.Initialize
chartseries.Add(CreateMap("value" : "#Sales#","line" : CreateMap("color":"#66cc00","width":"2"),"tooltip":CreateMap("template":"#Sales#"),"label":"#Sales#"))
chartseries.Add(CreateMap("value" : "#Sales1#","line" : CreateMap("color":"#1293f8","width":"2"),"tooltip":CreateMap("template":"#Sales1#"),"label":"#Sales1#"))


legendvalue.Initialize 	
legendvalue.Add(CreateMap("text" : "Sales","color":"#66cc00"))
legendvalue.Add(CreateMap("text" : "Sales 1","color":"#1293f8"))

chTypeSpline.Initialize("chartsales").SetTypeSPLine("").SetStyle("font-weight","bold").SetData(salesdataDB)
chTypeSpline.SetAttr("legend",CreateMap("values" : legendvalue,"align":"center","valign":"middle","layout":"x","width": 300,"margin": 0))
chTypeSpline.SetAttr("series",chartseries)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…