ChartDirector Advice

I’m contemplating using ChartDirector with Shorts to add charts (obviously). The problem I have is that I’m really unsure how to proceed. We’ve used ChartDirector for years with many projects but we’ve always coded it specific for a project. We need a Pie chart so we mess with the Pie Chart code until we get it to work like we want.

With Shorts being a reporting tool I need to make it pretty generic. I won’t know how big the user has made the chart area until we go to render the report. One thing we’ve always struggled with is the plot area versus what available area and then the label sizes and so on after that.

I’m struggling with trying to make Chart Director easy enough to use with Shorts and coming up with blanks. So I’m wondering if anyone has any advice?

Hi bob

You need to talk to @David Cox I think.
I think he has done lots of work on this stuff.

When I am in the dark, I usually either ask for advice or check the concurencey or… say, in your case: Excell, LibreOffice, etc.

I wanted to add into a Pro-Bono project a Chart, then I started a Pie Chart, used LibreOffice as an idea provider and at last, once I was near the end (for the Pie Chart only, no bar, no lines, no…), I realized that I do not need to do that because I already gives the data inside a text file and they use LibreOffice for other stuff. In my case, it woul took too long to add Pie + Bars (vertical, Horizontal), lines (strait lines, dots lines, .-.-, etc), adding a 3D effect, etc. So, I gave up the idea, only add some sentences in the manual where I talk about statistics (export the values and use LibreOffice to generate the Charts). Of course, this is not your case.

BTW: I just looked at https://en.wikipedia.org/wiki/Pie_chart and I learned things about chart (not about developments) !

Kansas City: Missouri or Kansas state ?

First I have not seen or used Shorts, so I may be off base here.

IMO ChartDirector simply has way too many options for someone wanting to do quick reports within a reporting tool.

I think what you have to do is decide on chart types to support and then write a simplified less flexible API for each of those chart types

Maybe you also have a “expert” Chart type that lets them do whatever they want as well.

That said, unless you need that for your operation anyway, I’m not sure the amount of work it would take to make it “easy” would be worth it.

What might make sense is not doing much more besides defining the size and position of the chart on the page, and let the end user write all the MBSChartDirector code that creates a picture for that area (which you may already support), maybe in an event you define.

That way you would not be tied to a single charting packages well.

[quote=299176:@Bob Keeney]I’m contemplating using ChartDirector with Shorts to add charts (obviously). The problem I have is that I’m really unsure how to proceed. We’ve used ChartDirector for years with many projects but we’ve always coded it specific for a project. We need a Pie chart so we mess with the Pie Chart code until we get it to work like we want.

With Shorts being a reporting tool I need to make it pretty generic. I won’t know how big the user has made the chart area until we go to render the report. One thing we’ve always struggled with is the plot area versus what available area and then the label sizes and so on after that.

I’m struggling with trying to make Chart Director easy enough to use with Shorts and coming up with blanks. So I’m wondering if anyone has any advice?[/quote]

for me chartdirector 's document is a little not easy to understand… I hope we can have more example,and simple APIs…

Well, ChartDirector is a huge library. It has all the features people asked for over the years.

You may need to define the chart types you want to support, write for each a method and allow a few parameters to vary.

Colors, Text, locations on the Chart, user modifiable…

@Bob Keeney I was planning to use Chart Director and Shorts together and was going to approach it from with the idea of generating png files from Chart Director and then adding those png files as pictures to Shorts and just resizing them to fit.

So, say I want a report showing sales data with a little chart for each sales rep. I was going to generate a temporary database file that included charts as BLOBs (outputting charts as PNGs for this purpose) to pass in as picture objects to Shorts.

Are you planning to do something more in depth than that? I’m very interested in the direction you are thinking of taking with this. Maybe it will give me some ideas of my own.

I plan on the charting to be more integrated than that. For the group we’ll have a chart that is generated from the data itself so you don’t have to put anything into the database. We create the chart and get the image from it. Obviously more involved than that, but we want the process to be as simple as possible so that end users could create their own report with chart without needing too much more.

There is one area that I need to do more exploration: the resolution of screen, versus printer, versus PDF are vastly different. We only generate the chart once so coming up with a high enough resolution image to satisfy all three, yet still remain fast enough, is going to be a challenge.

I guess I’ll have to start with a chart type, implement it and see where it leads me.

[quote=299263:@Bob Keeney]I plan on the charting to be more integrated than that. For the group we’ll have a chart that is generated from the data itself so you don’t have to put anything into the database. We create the chart and get the image from it. Obviously more involved than that, but we want the process to be as simple as possible so that end users could create their own report with chart without needing too much more.

[/quote]
Why try to do printer resolution for everything?

I have a chart that I draw to screen and print and that adjusts to moving it’s window from a ‘normal’ to Retina screen. I used the same chart generation code (called though an event) for all of that, but I pass in the point dimensions of the chart and a scale factor for use with the ScaleFactor that Christian added recently to support retina.

While the new ScaleFactor parameter Christian added is not perfect, it simplified creating different resolution charts a good bit. Things work fast enough that regenerating the chart when I need a different resolution for screen display or printing is not an issue for me. ( After getting the data from the DB. I do cache it so redrawing happens without needed to access the DB again).

  • Karen

I have created a generic ChartDirector tool as @Russ Lunn mentioned. Originally it was ‘fed’ by a WebListBox for data:

producing a generic chart:

And a WebPage for the options (happs.webappdevelopments.com:9001):

But then I needed to build charts using an interface-less Console. It now uses a Module for the options containing every option plus two string arrays: one array for the labels and the other for the numerical data (tab-delimited if multiple lines needed). It returns both the Picture of the chart and the PDF string, so you can display or print it however you want.
I can now place the charts anywhere I want, even multiple times on a WebPage with the options accessed through a couple of WebDialogs. These WebDialogs merely update the generic Module’s settings, but they do it live:

I’ve even created new charts that chop a Pie chart in half and add a table below, all inside ChartDirector, then place a dozen of them on the WebContainer:

The code is not pretty, but it is quite functional!