Beispiel #1
0
 def replace_fixture(self, chart_data_, SeriesXmlRewriterFactory_,
                     series_rewriter_, workbook_, workbook_prop_):
     chartSpace = element('c:chartSpace/c:chart/c:plotArea/c:pieChart')
     chart = Chart(chartSpace, None)
     chart_type = XL_CHART_TYPE.PIE
     xlsx_blob = 'fooblob'
     chart_data_.xlsx_blob = xlsx_blob
     return (chart, chart_data_, SeriesXmlRewriterFactory_, chart_type,
             series_rewriter_, chartSpace, workbook_, xlsx_blob)
Beispiel #2
0
 def legend_fixture(self, request, Legend_, legend_):
     chartSpace_cxml, has_legend = request.param
     chartSpace = element(chartSpace_cxml)
     chart = Chart(chartSpace, None)
     expected_value, expected_calls = None, []
     if has_legend:
         expected_value = legend_
         legend_elm = chartSpace.chart.legend
         expected_calls.append(call(legend_elm))
     return chart, Legend_, expected_calls, expected_value
Beispiel #3
0
    def it_provides_access_to_its_font(self, font_fixture, Font_, font_):
        chartSpace, expected_xml = font_fixture
        Font_.return_value = font_
        chart = Chart(chartSpace, None)

        font = chart.font

        assert chartSpace.xml == expected_xml
        Font_.assert_called_once_with(
            chartSpace.xpath("./c:txPr/a:p/a:pPr/a:defRPr")[0])
        assert font is font_
Beispiel #4
0
 def category_axis_fixture(self, request, CategoryAxis_, DateAxis_, ValueAxis_):
     ax_tag = request.param
     chartSpace_cxml = "c:chartSpace/c:chart/c:plotArea/%s" % ax_tag
     chartSpace = element(chartSpace_cxml)
     chart = Chart(chartSpace, None)
     AxisCls_ = {
         "c:catAx": CategoryAxis_,
         "c:dateAx": DateAxis_,
         "c:valAx": ValueAxis_,
     }[ax_tag]
     axis_ = AxisCls_.return_value
     xAx = chartSpace.xpath(".//%s" % ax_tag)[0]
     return chart, axis_, AxisCls_, xAx
Beispiel #5
0
 def title_fixture(self, request, ChartTitle_, chart_title_):
     chartSpace_cxml, expected_cxml = request.param
     chart = Chart(element(chartSpace_cxml), None)
     expected_xml = xml(expected_cxml)
     return chart, expected_xml, ChartTitle_, chart_title_
Beispiel #6
0
 def style_get_fixture(self, request):
     chartSpace_cxml, expected_value = request.param
     chart = Chart(element(chartSpace_cxml), None)
     return chart, expected_value
Beispiel #7
0
 def style_set_fixture(self, request):
     chartSpace_cxml, new_value, expected_chartSpace_cxml = request.param
     chart = Chart(element(chartSpace_cxml), None)
     expected_xml = xml(expected_chartSpace_cxml)
     return chart, new_value, expected_xml
Beispiel #8
0
 def plots_fixture(self, _Plots_, plots_):
     chartSpace = element("c:chartSpace/c:chart/c:plotArea")
     plotArea = chartSpace.xpath("./c:chart/c:plotArea")[0]
     chart = Chart(chartSpace, None)
     return chart, plots_, _Plots_, plotArea
Beispiel #9
0
 def series_fixture(self, SeriesCollection_, series_collection_):
     chartSpace = element("c:chartSpace/c:chart/c:plotArea")
     plotArea = chartSpace.xpath(".//c:plotArea")[0]
     chart = Chart(chartSpace, None)
     return chart, SeriesCollection_, plotArea, series_collection_
Beispiel #10
0
 def chart_type_fixture(self, PlotTypeInspector_, plot_, chart_type_):
     chart = Chart(None, None)
     chart._plots = [plot_]
     return chart, PlotTypeInspector_, plot_, chart_type_
Beispiel #11
0
 def chart(self):
     """|Chart| object representing the chart in this part."""
     return Chart(self._element, self)
Beispiel #12
0
 def series_fixture(self, SeriesCollection_, series_collection_):
     chartSpace = element('c:chartSpace')
     chart = Chart(chartSpace, None)
     return chart, SeriesCollection_, chartSpace, series_collection_
Beispiel #13
0
 def chart_type_fixture(self, PlotTypeInspector_, plot_):
     chart = Chart(None, None)
     chart._plots = [plot_]
     chart_type = XL_CHART_TYPE.PIE
     PlotTypeInspector_.chart_type.return_value = chart_type
     return chart, PlotTypeInspector_, plot_, chart_type
Beispiel #14
0
 def chart_type_fixture(self, PlotTypeInspector_, plot_, chart_type_):
     chart = Chart(None, None)
     chart._plots = [plot_]
     return chart, PlotTypeInspector_, plot_, chart_type_
Beispiel #15
0
 def cat_ax_raise_fixture(self):
     chart = Chart(element('c:chartSpace/c:chart/c:plotArea'), None)
     return chart
Beispiel #16
0
 def val_ax_fixture(self, ValueAxis_, value_axis_):
     chartSpace = element('c:chartSpace/c:chart/c:plotArea/c:valAx')
     valAx = chartSpace.xpath('./c:chart/c:plotArea/c:valAx')[0]
     chart = Chart(chartSpace, None)
     return chart, value_axis_, ValueAxis_, valAx
Beispiel #17
0
 def series_fixture(self, SeriesCollection_, chartSpace_,
                    series_collection_):
     chart = Chart(chartSpace_, None)
     return chart, SeriesCollection_, chartSpace_, series_collection_
Beispiel #18
0
 def replace_data_fixture(self, chartSpace_, chart_part_, chart_data_,
                          _SeriesRewriter_):
     chart = Chart(chartSpace_, chart_part_)
     workbook_ = chart_part_.chart_workbook
     return (chart, chart_data_, _SeriesRewriter_, chartSpace_, workbook_)
Beispiel #19
0
 def val_ax_fixture(self, request, ValueAxis_, value_axis_):
     chartSpace_xml, idx = request.param
     chartSpace = element(chartSpace_xml)
     chart = Chart(chartSpace, None)
     valAx = chartSpace.xpath(".//c:valAx")[idx]
     return chart, ValueAxis_, valAx, value_axis_
Beispiel #20
0
 def has_title_set_fixture(self, request):
     chart_cxml, new_value, expected_cxml = request.param
     chart = Chart(element("c:chartSpace/%s" % chart_cxml), None)
     expected_xml = xml(expected_cxml)
     return chart, new_value, expected_xml
Beispiel #21
0
 def val_ax_raise_fixture(self):
     chart = Chart(element("c:chartSpace/c:chart/c:plotArea"), None)
     return chart
Beispiel #22
0
 def cat_ax_fixture(self, CategoryAxis_, category_axis_):
     chartSpace = element('c:chartSpace/c:chart/c:plotArea/c:catAx')
     catAx = chartSpace.xpath('./c:chart/c:plotArea/c:catAx')[0]
     chart = Chart(chartSpace, None)
     return chart, category_axis_, CategoryAxis_, catAx