I got this to work by using HSSFName. Set up your chart to use a named range in the Excel template. At runtime, find the HSSFName with the same name as your named range (I looped through the names because I only have a few; you could map them). Change the range value to reference a different range, it can even be of a different size.
Even with a 3D chart, if you can find one axis that has a constant number of values then align your (multiple) series along those values using multiple named ranges in the Excel template. Then at runtime update each named range in code. This might be a good thing to put in the FAQ (or maybe it's already obvious to everyone but me). For our purposes this allows most of the chart manipulation we could ever want. I knew that I could set up a chart that referenced 3 cells and then change the values in those cells; until I discovered this trick I didn't know that you could change the number of cells included in a chart. POI contributors, if you're watching the users list, thanks! Jeff ----- Original Message ----- From: <[EMAIL PROTECTED]> To: "POI Users List" <[EMAIL PROTECTED]> Sent: Sunday, November 23, 2003 5:38 PM Subject: Re: Change Chart Data Range > Sorry, no. What you can do is change the data inside a pre-existing range. > > Quoting Jeff Nadler <[EMAIL PROTECTED]>: > > > Hi, > > > > I'm using 2.0 RC1. Can anyone tell me if this functionality made it into > > 2.0: > > > > I'd like to access an existing chart and change the data range for the > > chart using POI. > > > > Or, for a 3d chart, how about adding new series/data ranges to an existing > > chart? > > > > Thanks for any info- > > > > Jeff > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
