User (Legacy) Posted July 10, 2002 Report Share Posted July 10, 2002 Hi there, We currently have a J2EE application that, as one of it's features, needs to deliver highly-formatted content. For charting, we initially implemented Popcharts because they have a simple Java interface, and we can talk to it easily with HTTP. I am now porting the functionality to ChartFX IE. Because our code is in a J2EE application server, we have had to be creative in how we communicate with the softwareFX stuff. To pull all this off, what I've done is to use the chartfx XML interface for both properties and data. So, my Java application code generates the XML for the properties, and the XML for the data. It then Base64 encodes the properties XML and data XML and sends them to an ASP I wrote that pulls the parameters off the URL, base64 decodes them back into their XML, and submits them to the chart. It sounded pretty quick and easy at the time, but I've run into several road-blocks: Here is where my design questions come in... 1) Column names in the XML data: Column names in real life can contain spaces, and special characters such as "%" and "#". These are invalid characters in the XML definition: <?xml version="1.0"?> <DATA> <COLUMNS> <COLUMN NAME="Market" TYPE="STRING"/> <COLUMN NAME="Profit %" TYPE="FLOAT"/> <COLUMN NAME="Cost #" TYPE="FLOAT"/> </COLUMNS> <ROW Market="Acton" Profit %="1457.0" Cost #="12.0" /> <ROW Market="Akron" Profit %="3666.0" Cost #="13.2" /> <ROW Market="Albuquerque" Profit %="11264.0" Cost #="7.6" /> </DATA> For example, the above is invalid XML because Profit % is not a valid key name, and neither is Cost #. To work around this, I've had to make-up column names in both the column name definitions, and the Row specifications, and then pass my custom ASP the real names of the series in parameters. My ASP then has to troll the parameters looking for the replacements for the series legends. Here are my questions on this one: a) Is there a different format of the XML I can generate that won't have this problem. If not, then will SoftwareFX consider adding additional strings or pieces in there that would let me rename the items in the column definition. Such as: <COLUMN NAME="Column3" TYPE="FLOAT" LEGEND="Profit %"/> The Column named "Market" isn't a series legend. Is it recorded in the chart anywhere that I need to replace it. 2) I can't specify the location of the series legend in the XML. To work around this, I've had to pass additional parameters to my ASP to specify the location of the series legend. The code looks like this: ' Kludge around some things that I cant specify in the XML if (legStr = "bottom") then chart.SerLegBox = true chart.SerLegBoxObj.Docked = 258 elseif (legStr = "top") then chart.SerLegBox = true chart.SerLegBoxObj.Docked = 256 elseif (legStr = "left") then chart.SerLegBox = true chart.SerLegBoxObj.Docked = 513 elseif (legStr = "right") then chart.SerLegBox = true chart.SerLegBoxObj.Docked = 515 else chart.SerLegBox = false end if if (pieLeg = "bottom") then chart.LegendBox = true chart.LegendBoxObj.Docked = 258 elseif (pieLeg = "top") then chart.LegendBox = true chart.LegendBoxObj.Docked = 256 elseif (pieLeg = "left") then chart.LegendBox = true chart.LegendBoxObj.Docked = 513 elseif (pieLeg = "right") then chart.LegendBox = true chart.LegendBoxObj.Docked = 515 else chart.LegendBox = false end if chart.ToolBar = false Pretty nasty, eh? The question is - what am I missing? Do I really have to do it this way? I'm an old ChartFX 2.x and 3.x developer, and it seems to me that there used to be SetToolLocation call that would allow me to specify the location of a given tool without using the chart object. This would be perfect for the XML. Of course, so would direct access to the specific tool. Thanks in advance, Marc Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.