Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | enable reverse scales on axes | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | General | Reporter: | rmedlicott <richard.medlicott> | ||||||
Component: | chart | Assignee: | kla <thomas.klarhoefer> | ||||||
Status: | CLOSED FIXED | QA Contact: | issues@graphics <issues> | ||||||
Severity: | Trivial | ||||||||
Priority: | P3 | CC: | eliyuan, gaozemin, ht990332, IngridvdM, issues, nando.carvalho, tony.galmiche.ooo | ||||||
Version: | 3.3.0 or older (OOo) | Keywords: | ms_interoperability, rfe_eval_ok | ||||||
Target Milestone: | --- | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
URL: | http://specs.openoffice.org/chart/Chart_Scales_and_Intervals.odt | ||||||||
Issue Type: | FEATURE | Latest Confirmation in: | --- | ||||||
Developer Difficulty: | --- | ||||||||
Issue Depends on: | |||||||||
Issue Blocks: | 68552, 74660 | ||||||||
Attachments: |
|
Description
rmedlicott
2004-01-21 01:32:09 UTC
Hi Bettina, one for you. tk Chart on x axis reverse order for numbers would also be very helpful for Civil engineering soil analysis. Reassigned to Ingrid. Yes, this is a missing feature compared with similar products. *** Issue 30593 has been marked as a duplicate of this issue. *** accept issue added keyword Is this that difficult to solve? Where can I found this other functions like that in our source and i'll give a try for that. It's more than a year sinse reported and nothing is done, no one cares. Where is it, I can do something, just show me where is it please. Hi flcs. There is nothing happening here because the chart team is still busy with reimplement the whole chart from scratch. If you want to help implementing you are very welcome. The new implementation is done on the CWS chart2mst3. Have a look at the chart webpage for more details and further links: http://graphics.openoffice.org/chart/chart.html if you like. To implement this feature additional GUI is needed at the Scale tabpage ( look for the implementation in chart2/source/controller/tp_Scale.* on branch chart2mst3 ) and a fileformat extension to save and load the settings (xmloff) is also necessary. The new chart is in principle already able to reverse axis: see ::com::sun::star::chart2::ScaleData and ::com::sun::star::chart2::AxisOrientation but there is some additional handling around missing. *** Issue 71174 has been marked as a duplicate of this issue. *** *** Issue 69647 has been marked as a duplicate of this issue. *** changed target to 2.x hint for development: First we need a check box, where the user can switch the direction of the axes. A good place might be the scale tabpage of the axis properties dialog. The source code for this tabpage is in: chart2/source/controller/dialogs/tp_Scale.hxx chart2/source/controller/dialogs/tp_Scale.cxx chart2/source/controller/dialogs/tp_Scale.src chart2/source/controller/dialogs/TabPages.hrc Look how the implementation works for the similar checkbox CBX_LOGARITHM on the same page and try to introduce the new checkbox 'CBX_REVERSE'in the same way. ->iha I have added a checkbox on the the scale tabpage of the axis properties dialog. and, the next step is ->iha I have fixed the issue, I will send the patch to you to review later. :-) The chart model is already prepared to keep the information 'reverse scale'. It is in the member 'Orientation' in the ScaleData of each axis (see UNO interface ::com::sun::star::chart2::XAxis and UNO struct ::com::sun::star::chart2::ScaleData and UNO enum ::com::sun::star::chart2::AxisOrientation). So the next step will be to transport the information from the dialog to the chart model. Many dialogs in OpenOffice are designed to get input and return output via objects of type 'SfxItemSet' (you can find this class in module svtools/inc/svtools/itemset.hxx). Multiple Items of different type can be stored and accessed via Ids (nWhich). We only need a bool value thus a SfxBoolItem will do. We also need to define a new ID SCHATTR_AXIS_REVERSE. Look how this is made for the logarithmic state information (SCHATTR_AXIS_LOGARITHM). The SfxItemSet for the axis is filled in the AxisItemConverter (chart2/source/controller/itemsetwrapper/AxisItemConverter.hxx and cxx). Look what is done there for SCHATTR_AXIS_LOGARITHM and introduce the transport of the 'reverse' information for the new ID SCHATTR_AXIS_REVERSE. As the view already reads and reacts to the model information you should be able to see the reverse axis when the transport of information from dialog to model is working correctly. I see you did the second step already. Fine. So next we need to provide the new information at the old Chart UNO API as this is used to load and save the axis information. The wrapper for the old Axis API is in chart2/source/controller/chartapiwrapper/AxisWrapper.hxx and cxx. Look how the similar property "Logarithmic" is offered and introduce a new optional boolean property "ReverseDirection" for the service ::com::sun::star::chart::ChartAxis. The values are transported to and from the new API via the class WrappedScaleProperty. Look how it is done for SCALE_PROP_LOGARITHMIC there. ->iha I have changed the patch file according to your suggestions. Please review it again. :) Fine, the next step will be to transport the new information from the API to the file. This is be done in module /xml/xmloff in general. The next version of ODF fileformat will allow a new attribute "reverse-direction" for chart axes. In xmloff we need a new Token XML_REVERSE_DIRECTION to represent this new XML attribute. It needs to be mapped to the UNO property "ReverseDirection". Look how this is done for XML_TEXT_OVERLAP. The only thing you can ignore about XML_TEXT_OVERLAP is what is happening in /xmloff/source/transform/PropertyActionsOOo.cxx as this is only necessary for old attributes and an older file format. When you have done these changes the reverse setting can be saved and loaded. I have been following this discussion with considerable interest, and have learned a lot from it. I am grateful for the work being done to improve things. Now we are talking about saving this attribute it appears, from context, as though it will be saved in odf format spreadsheets by the method proposed. What will that mean for "ms_interoperability"? How about picking up the reverse axis from excel files? Frankly, I am not at all impressed with the way that Excel handles reversed axis graphs, they end up looking a right mess.... Importing from and exporting to xcel is another step. This is currently done in module sc in /sc/sc/source/filter. The implementation for the reverse-axis feature is already prepared there. Just set the define EXC_CHART2_REVERSE_AXIS to 1 or remove it completely and it should work. ->iha Great, the reverse setting can be saved and loaded now. I have sent the third version patch of the issue to you to view, if it is ok, I will attach it to the issue. :) Now there is the problem left, that the scale tabpage is only available for value axes so far. Thus the user cannot set the reverse setting for category axes (x axis in most charts except xy). I think we should show the scale page also for category axes but then we need to hide and reorganize some controls. Which pages are shown in the properties dialog for chart objects is managed by the class ObjectPropertiesDialogParameter. We have a method HasScaleProperties() there so far. This method should be replaced by two new methods to distinguish a scale page for value axes from a scale page for category axes: HasValueScaleProperties() HasCategoryScaleProperties() I think in a first step we can try to reuse the SchScaleYAxisTabPage for both scenarios and make it dependent on a new parameter. Then we need new factory methods to create the different scale pages: replace static SfxTabPage* SchScaleYAxisTabPage::Create( Window* pParent, const SfxItemSet& rInAttrs ); by twi new methods CreateValueScalePage and CreateCategroyScalePage. If this is working we can cleanup the scale page for case of category axes thus only those controls are shown that fit this case. Created attachment 46460 [details] The attachment is the patch of issue 24614, thanks to Ingrid changed target I hope that the axis reversal capability will include reversed logarithmic horizontal ("X") axes. I use OO 2.2 to display results of a geophysical survey technique known as magnetotelluric sounding. It is conventional in the industry to display the results on a log-log graph, with the frequency (horizontal) axis being reversed - low frequencies e.g. 0.00005 Hz on the left, and high frequencies e.g. 1,000 Hz on the right. At present I fudge it by displaying 1/Frequency - but this is a definite kludge! Thanks for OO - I use it every day. Fixed in CWS chart14. I changed the scale specification according to this new feature: http://specs.openoffice.org/chart/Chart_Scales_and_Intervals.odt Furthermore I did correct an issue in the patch regarding the AllAxes-properties dialog. And did some more changes to reduced code complexity further. jack_dodds: yes, also log x-axes can be reversed ->Thomas, please verify in CWS chart14. Please also test the excel im-/export for this feature. I tested the excel import for this feature and it works. I did a chart with Y axis reversed and X axis logarithmic and saved it as an excel spreadsheet at university. I saved it on a usb drive and when I opened it at home on my Linux computer with OpenOffice.org built with the patch, it imported it correctly and the Y axis is still reversed. Created attachment 48782 [details]
TCS
seen ok in cws chart 14 -> verified seen ok in current master -> closed |