Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Jun 25, 2017 2:13 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: MBS Chart Director
PostPosted: Tue Jun 26, 2012 12:44 pm 
Offline

Joined: Fri Jun 05, 2009 4:54 pm
Posts: 484
Location: London, England
Hello,
Can anyone who may be using MonkeyBread's ChartDirector plugin tell me how to:

A) Make all of the bars appear the same colour (as opposed to random colours).

B) Remove the default white background behind the bars.

Thank you all in advance.

_________________
RealStudio Professional Edition 2012 r2
Developing on OS X 10.8 (Mountain Lion)
Deploying on Windows XP / Vista / 7 / 8


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Chart Director
PostPosted: Tue Jun 26, 2012 12:59 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Well, if you call addBarLayer, you can pass a color or an array of colors for the bars. If you pass one color all bars have same color. If you pass array, you define the colors for the bars. If array is empty or has not enough values, you get default colors.

With background, you can pass different background color to CDXYChartMBS constructor for whole drawing area or to setPlotArea for plot area.
if you want complete transparent background, please look into the "simplePie with transparent background" example project.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Chart Director
PostPosted: Tue Jun 26, 2012 1:49 pm 
Offline

Joined: Fri Jun 05, 2009 4:54 pm
Posts: 484
Location: London, England
Christian,

OK, I have edited my code below, and now all of my bars are the same colour, but I still have no idea how to change the default color, or how to make then 3d:

dim u,i as integer

dim data(-1) as double
dim labels(-1) as string

u=list.ListCount-1
for i=0 to u
labels.Append list.Cell(i,0)
data.Append val(list.cell(i,1))
next

dim c as new CDXYChartMBS(canvas1.Width, canvas1.Height)
dim colors(-1) as integer
colors.Append CDXYChartMBS.RGB(202,225,255)

call c.setPlotArea(30,20, Canvas1.Width-50, canvas1.Height-50)

call c.addBarLayer (data)

call c.xAxis.setLabelS labels

canvas1.Backdrop=c.makeChartPicture


Thanks for trying to help, but I guess I will have to make do with my plain old bars.

Thanks.

_________________
RealStudio Professional Edition 2012 r2
Developing on OS X 10.8 (Mountain Lion)
Deploying on Windows XP / Vista / 7 / 8


Last edited by RicSum on Tue Jun 26, 2012 2:17 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Chart Director
PostPosted: Tue Jun 26, 2012 2:16 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
See this lines:

dim colors(-1) as integer
colors.Append CDXYChartMBS.RGB(202,225,255)

call c.setPlotArea(30,20, Canvas1.Width-50, canvas1.Height-50)

call c.addBarLayer (data, colors)


How about you change this to.

call c.setPlotArea(30,20, Canvas1.Width-50, canvas1.Height-50)
call c.addBarLayer (data, CDXYChartMBS.RGB(202,225,255))


by removing the array, you don't get the default color palette.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Chart Director
PostPosted: Tue Jun 26, 2012 2:19 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
And next, for the glass effect, you could simply go on:
call c.addBarLayer (data, CDXYChartMBS.RGB(202,225,255))

Replace the call with
dim layer as CDBarLayerMBS =

so you have
dim layer as CDBarLayerMBS = c.addBarLayer (data, CDXYChartMBS.RGB(202,225,255))

This way you have the layer object in an extra variable.
So you can run this code
layer.setBorderColor(c.kTransparent, c.glassEffect(c.kNormalGlare,c.kLeft))

For adding glass effect to borders.
First parameter here gives transparent borders and second part adds a glass effect with normal glare and light from left.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Chart Director
PostPosted: Tue Jun 26, 2012 2:20 pm 
Offline

Joined: Fri Jun 05, 2009 4:54 pm
Posts: 484
Location: London, England
Thank you very much Christian - I now have all bars the same color, of which I can now choose.

_________________
RealStudio Professional Edition 2012 r2
Developing on OS X 10.8 (Mountain Lion)
Deploying on Windows XP / Vista / 7 / 8


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Chart Director
PostPosted: Tue Jun 26, 2012 2:37 pm 
Offline

Joined: Fri Jun 05, 2009 4:54 pm
Posts: 484
Location: London, England
Is it possible to advise me how to make my bars 3D ?
I can then leave people in peace and study all of the code provided.

I really appreciate all the help - FOR ME, it is soooooo much easier to learn from example code, as I often do not understand general pointers.

Thank you VERY much.

_________________
RealStudio Professional Edition 2012 r2
Developing on OS X 10.8 (Mountain Lion)
Deploying on Windows XP / Vista / 7 / 8


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Chart Director
PostPosted: Tue Jun 26, 2012 2:48 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
To find out how to make 3D bar, go to the examples for ChartDirector plugin. More than 200 examples, so go in icon mode in Finder/Explorer and look on the thumbnails we have there.
Once you find threedbar.rbp, open it and look inside. There you see:
// Add a bar chart layer with green (0x00ff00) bars using the given data
dim b as CDBarLayerMBS
b=c.addBarLayer(data, &h00ff00)
b.set3D

As you see this example creates bars with a single color (what you asked above).
Now you see a call there with set3D. Add this to your project.

Look here for docs:
http://www.monkeybreadsoftware.net/char ... d.shtml#25

So you see you can pass two parameters here, if you like.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Chart Director
PostPosted: Tue Jun 26, 2012 3:04 pm 
Offline

Joined: Fri Jun 05, 2009 4:54 pm
Posts: 484
Location: London, England
FANTASTIC !

Danke sehr für alle Ihre hilfe Christian - Ich bin SEHR dankbar !

_________________
RealStudio Professional Edition 2012 r2
Developing on OS X 10.8 (Mountain Lion)
Deploying on Windows XP / Vista / 7 / 8


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group