MBS Chart Director ... A Simple Question (I Think?)

OK, now I see why people complain about Chart Director documentation. Bought it last week and fired it up for the first time early this morning. I am simply trying to figure out how to position the chart (the outer box, not the plot area) at some x,y (left, top) coordinates in the main window. I looked through a dozen or more examples and all I see is where the “Plot Area” is defined as far as size and location. The chart itself in all the examples seems to be located at 0,0. I’ve spent a whole day now looking through the classes and functions as well as trying numerous examples and I still fail to see anything that tells me how to position the chart at some x,y set of coordinates. I am sure there’s a dirt-simple answer, but I’ve given it the “old college try” and failed miserably … anyone out there who has Chart Director want to save me another day of looking?

Thanks in advance for your time and consideration.
… Don

Visit chart directors website and take a look at the c documentation, https://www.advsofteng.com/doc/cdcpp.htm#cover.htm the code examples may assist. I have not got access to my code currently for a simple copy and paste for you but the website above is a great resource and simpler to follow.

Thanks for your response, Paul. I’ve spent the last 20 minutes looking at the site you suggested but have not found anything to answer my basic question of “how do I position the bounding box for a bar chart”. The examples out there are, for the most part, the same ones included with ChartDirector when you download it from MBS. They all show how to “size” the bounding box and how to size and position the plot area, but not how to position the chart (bounding box) itself. The “Getting Started” section didn’t even explain it. I will say that the “c website” is very well organized and a helluva lot easier to find something with the hierarchical tree menu provided. Unfortunately, I just didn’t find what I needed.

Do you mean how to position the canvas on the window?
Because that is not in ChartDirector, but in Xojo.

[quote=417927:@Christian Schmitz]Do you mean how to position the canvas on the window?
Because that is not in ChartDirector, but in Xojo.[/quote]
What canvas??? I don’t see any canvas in the controls section of the window in each of the examples. Where does it talk about using a canvas?

I assumed the control example.

But well all the examples just render a picture and draw it in a window.
You can draw it in a canvas instead, so the position in the window changes.

[quote=417961:@Christian Schmitz]But well all the examples just render a picture and draw it in a window.
You can draw it in a canvas instead, so the position in the window changes.[/quote]
Thanks for the response, Christian. I didn’t see this anywhere in any document during the whole day I looked for the answer. So, where is this referenced (which of the examples sent as part of the ChartDirector download?) so I can see how to “draw it into a canvas”???

Did you check the example project named “ChartDirector Control”?

or one of those here:

  • Track Line with Legend
  • Track Line with Legend Retina
  • Track Line with Data Labels
  • Track Line with Data Labels Retina
  • Track Line with Axis Labels
  • Track Box with Legend
  • symbolline zoom
  • symbolline zoom improved
  • symbolline datezoom
  • symbolline datezoom with date
  • smallsectorpie print
  • simpleline realtime
  • simpleline day
  • simpleline day with shadow
  • simplebar with ImageMapHandler
  • roundmeters with animation
  • roundmeter with control
  • quadview
  • multiameter with controls
  • math function plot
  • math function plot centered
  • math function plot centered and axes
  • finance with ChartDirector Control
  • Finance Chart Track Line
  • Finance Chart Track Line Retina
  • Crosshair with Axis Labels
  • ChartDirector Control
  • ChartDirector Control Retina
  • animated bar
  • animated bar Japanese

No, but I’m headed there right now as soon as I get done typing this. I’ll let you know if that answers things.

As for the list you show, the “animated bar” is one I looked at, but for the most part I was sticking to what looked like the “basic getting started” charts (e.g., bar, hbar, glass multibar etc.)

Well, after looking at the “ChartDirector Control” example you referenced, Christian, I can see what looks like creating a picture of the chart and embedding it into a canvas (which can then be positioned). Trouble is, the “Control” example you reference is substantially more complicated than the “simplebar” type examples that I was able to wrap my head around. It may take me awhile to grasp what all is being done in the “Control” example. I guess I’ll just dig in and see where it takes me … I do wish there was a “starter” example with just a simple bar chart that could be positioned in the window … call me dense, but it would save a ton of my time right now.

Well, take the simplebar example?

Go to the window, make it bigger and put somewhere a new canvas control.
The new canvas should be 250 by 250 pixels big.

It’s named Canvas1 here. So we change code:

 Canvas1.Backdrop=c.makeChartPicture

by referencing canvas, the picture goes there.
Does that work for you?

Yep! Sure does! Now THAT, I get. I kept focusing on the list of all classes and functions in the docs thinking there was some command there (like setPos is for the Plot Area) for the chart bounding box that I was missing. I thought you could “position” the rendered chart anywhere in the window you desired based on setting the appropriate coordinates. Bottom line is that is NOT how it’s done. Thanks for steering me in the right direction!

But you can create a Chart put it into a Picture Object and draw this anywhere you like. :wink:

Thanks, Sascha! That makes sense when I think about it.
ChartDirector is reminding me a lot of when I got dynaPDF … took me forever to get out of the starting blocks, but once I did, progress came pretty fast.