Difference between revisions of "Calc/Implementation/Chart Filter Process"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Created page with "This wiki is about the ODF filter process of chart. == '''Classes''' == In ODF filter (xmloff), there are 4 major classes used to do filter works of key chart elements: * SchXM…")
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
[[Category:Calc]]
 +
[[Category:Implementation]]
 +
 +
 
This wiki is about the ODF filter process of chart.
 
This wiki is about the ODF filter process of chart.
  
Line 11: Line 15:
 
SchXMLChartContext creates SchXMLPlotAreaContext after call it's StartElement method;  SchXMLPlotAreaContext creates SchXMLSeries2Context,  SchXMLSeries2Context creates SchXMLDataPointContext respectively after call their StartElement method.
 
SchXMLChartContext creates SchXMLPlotAreaContext after call it's StartElement method;  SchXMLPlotAreaContext creates SchXMLSeries2Context,  SchXMLSeries2Context creates SchXMLDataPointContext respectively after call their StartElement method.
  
http://wiki.services.openoffice.org/w/images/thumb/3/36/ChartFilterObjects.jpg/637px-ChartFilterObjects.jpg
+
[[File:ChartFilterObjects.jpg]]
  
 
SchXMLChartContext has a critical member maSeriesDefaultsAndStyles which stores default values for series and styles for series and data points. This member will be passed to SchXMLPlotAreaContext, SchXMLSeries2Context and SchXMLDataPointContext one by one as reference because the values can only be filled when the corresponding context begin to work.
 
SchXMLChartContext has a critical member maSeriesDefaultsAndStyles which stores default values for series and styles for series and data points. This member will be passed to SchXMLPlotAreaContext, SchXMLSeries2Context and SchXMLDataPointContext one by one as reference because the values can only be filled when the corresponding context begin to work.
Line 17: Line 21:
 
Similar as maSeriesDefaultsAndStyles, it is also passed to SchXMLPlotAreaContext and lower context one by one as reference and will be filled when the corresponding context begin to work.
 
Similar as maSeriesDefaultsAndStyles, it is also passed to SchXMLPlotAreaContext and lower context one by one as reference and will be filled when the corresponding context begin to work.
  
http://wiki.services.openoffice.org/w/images/4/4d/ChartFilterClasses.jpg
+
[[File:ChartFilterClasses.jpg]]
  
 
== '''Import Process''' ==
 
== '''Import Process''' ==
Line 24: Line 28:
 
But this process is only for chart whose mbAllRangeAddressesAvailable of SchXMLChartContext is true, which means there are no empty data sequence.
 
But this process is only for chart whose mbAllRangeAddressesAvailable of SchXMLChartContext is true, which means there are no empty data sequence.
  
http://wiki.services.openoffice.org/w/images/thumb/1/11/ChartImportProcess.jpg/800px-ChartImportProcess.jpg
+
[[File:ChartImportProcess.jpg]]
  
 
== '''Export Process''' ==
 
== '''Export Process''' ==
Line 30: Line 34:
 
This process is for both data series in column and data series in row. Copy will follow the same process.
 
This process is for both data series in column and data series in row. Copy will follow the same process.
  
http://wiki.services.openoffice.org/w/images/thumb/b/b2/ChartExportProcess.jpg/800px-ChartExportProcess.jpg
+
[[File:ChartExportProcess.jpg]]
  
 
== '''Import Process for charts which contain empty data sequences''' ==
 
== '''Import Process for charts which contain empty data sequences''' ==
Line 36: Line 40:
 
In this case, mbAllRangeAddressesAvailable of SchXMLChartContext is false. Basically, the process is same as normal import. The only difference is at the beginning of SchXMLChartContext.EndElement, it will additionally call ApplyDataFromRectangularRangeToDiagram because mbAllRangeAddressesAvailable is false. In this method, it will reorganise the data series, which will probably make delete old series and reset to new ones.
 
In this case, mbAllRangeAddressesAvailable of SchXMLChartContext is false. Basically, the process is same as normal import. The only difference is at the beginning of SchXMLChartContext.EndElement, it will additionally call ApplyDataFromRectangularRangeToDiagram because mbAllRangeAddressesAvailable is false. In this method, it will reorganise the data series, which will probably make delete old series and reset to new ones.
  
http://wiki.services.openoffice.org/w/images/thumb/4/4f/ChartComplexExportProcess.jpg/800px-ChartComplexExportProcess.jpg
+
[[File:ChartComplexExportProcess.jpg]]

Latest revision as of 01:54, 7 May 2012


This wiki is about the ODF filter process of chart.

Classes

In ODF filter (xmloff), there are 4 major classes used to do filter works of key chart elements:

  • SchXMLChartContext for whole chart
  • SchXMLPlotAreaContext for chart area
  • SchXMLSeries2Context for data series
  • SchXMLDataPointContext for data points

SchXMLChartContext creates SchXMLPlotAreaContext after call it's StartElement method; SchXMLPlotAreaContext creates SchXMLSeries2Context, SchXMLSeries2Context creates SchXMLDataPointContext respectively after call their StartElement method.

ChartFilterObjects.jpg

SchXMLChartContext has a critical member maSeriesDefaultsAndStyles which stores default values for series and styles for series and data points. This member will be passed to SchXMLPlotAreaContext, SchXMLSeries2Context and SchXMLDataPointContext one by one as reference because the values can only be filled when the corresponding context begin to work. Another critical member in SchXMLChartContext is mbAllRangeAddressesAvailable, which means whether the data sequences are all valid. For some charts, in special for stock charts, if the data source range is not correct, the chart will contain some empty data sequences. In this case, mbAllRangeAddressesAvailable will be false. Similar as maSeriesDefaultsAndStyles, it is also passed to SchXMLPlotAreaContext and lower context one by one as reference and will be filled when the corresponding context begin to work.

ChartFilterClasses.jpg

Import Process

This process is for both data series in column and data series in row. Paste will follow the same process. But this process is only for chart whose mbAllRangeAddressesAvailable of SchXMLChartContext is true, which means there are no empty data sequence.

ChartImportProcess.jpg

Export Process

This process is for both data series in column and data series in row. Copy will follow the same process.

ChartExportProcess.jpg

Import Process for charts which contain empty data sequences

In this case, mbAllRangeAddressesAvailable of SchXMLChartContext is false. Basically, the process is same as normal import. The only difference is at the beginning of SchXMLChartContext.EndElement, it will additionally call ApplyDataFromRectangularRangeToDiagram because mbAllRangeAddressesAvailable is false. In this method, it will reorganise the data series, which will probably make delete old series and reset to new ones.

ChartComplexExportProcess.jpg

Personal tools