Chart Director Manual

Thanks to some of you very helpful guys I’ve started to use MBS Chart Director and find it just what I was looking for.
I am, however, struggling to locate a manual/some syntax instructions/advice apart from the highly voluminous literature (running to several hundred pages) put out by MBS.
For example, I’m trying to insert some axis labels and find the syntax is ‘call c.xAxis.addLabel(position, label)’ where c is defined as 'new CDXYChartMBS(Width, Height)" but this simply doesn’t work.
There are several other things I would like to do, eg change colours of the lines, etc. and I wonder if there is a more concise set of instructions.

Well, the best may be to look for one of the examples to do what you need and adapt. That’s the reason we include 200+ examples with pictures to browse.

There is not always an example, so I just made this based on simple bar example:

[code]// The data for the bar chart
dim data(-1) as double = array(85.0, 156, 179.5, 211, 123)

// The labels for the bar chart
dim labels(-1) as string = array(“Mon”, “Tue”, “Wed”, “Thu”, “Fri”)

// Create a XYChart object of size 250 x 250 pixels
dim c as new CDXYChartMBS(250, 250)

// Set the plotarea at (30, 20) and of size 200 x 200 pixels
call c.setPlotArea(30, 20, 200, 200)

// add extra label
c.yAxis.addLabel(123, “Hello”)

// Add a bar chart layer using the given data
call c.addBarLayer(data)

// Set the labels on the x axis.
call c.xAxis.setLabels labels

Backdrop=c.makeChartPicture[/code]

This adds an extra label for 123 on the y axis.

Thanks Christian, will try your suggestions tomorrow.
Incidentally, it was not my intention to be critical of your Manual.

Cheers

Mike

In general I find the MBS docs hard to use.

In this case Christian is just mirroring the underlying ChartDirector API with basically teh names for classes with some additional name parts, so I used the online docs on the ChartDirector Website for a different language to quickly find the details I needed… You can quickly get the hang of figuring out the naming differences as well the call differences because of the different language… saved me a lot of time!

(besides which when I’m at work our firewall blocks access to Christian’s site as it claims it is a shareware site so I can’t use that when I don’t have his PDF handy)

Take a look at :
https://www.advsofteng.com/doc/cdcoldfusion.htm#cdref.htm

Hope that helps,

  • Karen

The plugin is based on the C++ version of ChartDirector:

https://www.advsofteng.com/doc/cdcpp.htm

Christian is alway great and very gentle.
Their products works pretty, pretty good. No bugs at all.
I have many of MBS his plugins (mostly all of them) and there are many examples.
But… I agree with Karen that “MBS docs hard to use”
If Christian dedicates some of his time to improve documentation, MBS products would be perfect (10 of 10).
Now they are 9.9 of 10, what it means also perfect.

Thanks guys. As usual you’ve given me plenty of stuff to work with !!

Mike

Hi guys. I’ve found out a lot today, but one thing is eluding me and that is how to change the colours of the line(s) in an XY line chart. Any ideas ??

I have not looked at my ChartDirector code for about a year so i don’t recall the details, but taking quick
look at my code, this statement sets both the color and line widths for a data set in a layer (you can add mutiple data sets/lines to a line layer

dim layer as CDLineLayerMBS layer=c.addLineLayer(CDBaseChartMBS.kSide) call layer.addDataSet(DataArray, theColor,"Name of DataSet").setLineWidth(2)

  • Karen

We use Call command often in Xojo to ignore function result.
But a lot of functions returns objects like layers, text boxes or data sets, which could be put in variables. Than you can call more methods there if needed.

Thanks Karen. I didn’t realise that when I downloaded Chart Director a whole spanof example files came along too. Had I known, it would have saved me hours of trawling the net looking for code examples - Durrrrr, how dorff can one get !!!

But thanks again, 'cos you keep pointing me in the right direction.

Mike