Return a |_BaseSeriesXmlRewriter| subclass appropriate to *chart_type*.
(chart_type, chart_data)
| 54 | |
| 55 | |
| 56 | def SeriesXmlRewriterFactory(chart_type, chart_data): |
| 57 | """ |
| 58 | Return a |_BaseSeriesXmlRewriter| subclass appropriate to *chart_type*. |
| 59 | """ |
| 60 | XL_CT = XL_CHART_TYPE |
| 61 | |
| 62 | RewriterCls = { |
| 63 | # There are 73 distinct chart types, only specify non-category |
| 64 | # types, others default to _CategorySeriesXmlRewriter. Stock-type |
| 65 | # charts are multi-plot charts, so no guaratees on how they turn |
| 66 | # out. |
| 67 | XL_CT.BUBBLE: _BubbleSeriesXmlRewriter, |
| 68 | XL_CT.BUBBLE_THREE_D_EFFECT: _BubbleSeriesXmlRewriter, |
| 69 | XL_CT.XY_SCATTER: _XySeriesXmlRewriter, |
| 70 | XL_CT.XY_SCATTER_LINES: _XySeriesXmlRewriter, |
| 71 | XL_CT.XY_SCATTER_LINES_NO_MARKERS: _XySeriesXmlRewriter, |
| 72 | XL_CT.XY_SCATTER_SMOOTH: _XySeriesXmlRewriter, |
| 73 | XL_CT.XY_SCATTER_SMOOTH_NO_MARKERS: _XySeriesXmlRewriter, |
| 74 | }.get(chart_type, _CategorySeriesXmlRewriter) |
| 75 | |
| 76 | return RewriterCls(chart_data) |
| 77 | |
| 78 | |
| 79 | class _BaseChartXmlWriter(object): |
searching dependent graphs…