reader.py 999 Bytes
Newer Older
1
from __future__ import absolute_import
panotwo's avatar
panotwo committed
2
# Copyright (c) 2010-2019 openpyxl
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

"""
Read a chart
"""

from .chartspace import ChartSpace, PlotArea
from openpyxl.xml.functions import fromstring

_types = ('areaChart', 'area3DChart', 'lineChart', 'line3DChart',
         'stockChart', 'radarChart', 'scatterChart', 'pieChart', 'pie3DChart',
         'doughnutChart', 'barChart', 'bar3DChart', 'ofPieChart', 'surfaceChart',
         'surface3DChart', 'bubbleChart',)

_axes = ('valAx', 'catAx', 'dateAx', 'serAx',)


19
20
def read_chart(chartspace):
    cs = chartspace
21
    plot = cs.chart.plotArea
CharlieC's avatar
CharlieC committed
22

23
24
    chart = plot._charts[0]
    chart._charts = plot._charts
25
26

    chart.title = cs.chart.title
27
28
    chart.display_blanks = cs.chart.dispBlanksAs
    chart.visible_cells_only = cs.chart.plotVisOnly
29
30
31
    chart.layout = plot.layout
    chart.legend = cs.chart.legend

CharlieC's avatar
CharlieC committed
32
33
34
35
36
    # 3d attributes
    chart.floor = cs.chart.floor
    chart.sideWall = cs.chart.sideWall
    chart.backWall = cs.chart.backWall

37
    return chart