Hi Regina,
Hello Bjoern,

Bjoern Milcke schrieb:
Hi Regina,
Hello,

I have written a calc-dokument which visualizes the Riemann sums of a definite integral, see http://www.rhenschel.homepage.t-online.de/oberuntersumme.ods It uses macros, which draw rectangles into a diagram. It works fine in OOo2.2, but with the new chart I get a runtime error, if I press "Rechtecke neu zeichnen" which calls TreppenAktalisieren. I guess that the amount of default objects (like title or legend) in a diagram has changed.
There might be something else in addition.
Nice Document/Chart!

First of all, the "Model" of the new chart no longer is derived from a draw model, that is it contains no shapes at all. (The shapes are contained in the view). So, when you add your own shapes, these are the only ones.

I fear, I'm not advanced enough to understand it and see the consequences without help.

Sorry for being technical. The only thing to know is that the shapes you get from the draw page are only those you added. The shapes generated for a chart (legend, title, etc.) are not included in this list. So the offset in your example will always be 0, also if you add some titles etc.

  In short:

change "Const MIN_INDEX% = 2" to "Const MIN_INDEX% = 0"

That seems to solve the IndexOutOfBoundsException. But the rectangles are not drawn.


I noticed also that the chart is not automatically updated. I haven't investigated, but maybe adding/removing of "additional" shapes does not trigger a modified state that refreshes the view. Only way to get the correct chart seems to be double click (unprotected) chart. The chart also behaves a bit weird, changes to the series or legend, etc. seem to have no effect.

In use, there should be no need to add/remove rectangles. There are always 2x250 rectangle present, most of them will be invisible because there are transparent. Changing the settings in Column B will (on command with the button) change the position, size, and transparency of the rectangles.

When you change the function in B2 or the x-range in B3 or B4 press "Wertetabelle neu berechnen" to get the new graph and afterwards press "Rechtecke neu zeichnen" to get the adapted rectangles. If you only change the settings for the rectangles in B8, B9, or B10, "Rechtecke neu zeichnen" will show the changes (at least in OOo2.2 it does).


I will investigate this when back at work (where I also have a more recent build).

It is nice, that you will have a closer look. It is only a sheet where pupils can explore the integral; getting it work would be good nevertheless.

When loading the document and starting to work with it, some strange things are happening. When you activate the chart, you can drag only the border of the legend and the text stays at the bottom. I haven't yet figured out what goes wrong here, but you can fix the file by loading it in the new chart and saving it again, and reload the file again. I presume it has to do with the fact that in older versions some chart objects (like the legend) might have been saved as additional shape in the file, which is incorrect.

Furthermore, changes to additional shapes (this is what we call the shapes you added with XDrawPage::add) do not trigger an update. Please write an issue for that to Ingrid (iha).

Until this bug is fixed, you can add the following:

oChartDocument.setModified( true )

(should also be possible to write "oChartDocument.modified = true)

after the oChartDocument.unlockControllers() statement, at all places where you want an update after the function, e.g. in the TreppenAktualisieren() function (last line of the Sub).

Alternatively, you can press F9 after you called a function with a button.

HTH,
Bjoern

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to