Return an instance of the appropriate subclass of _BaseSeries based on the xChart element *ser* appears in.
(ser)
| 235 | |
| 236 | |
| 237 | def _SeriesFactory(ser): |
| 238 | """ |
| 239 | Return an instance of the appropriate subclass of _BaseSeries based on the |
| 240 | xChart element *ser* appears in. |
| 241 | """ |
| 242 | xChart_tag = ser.getparent().tag |
| 243 | |
| 244 | try: |
| 245 | SeriesCls = { |
| 246 | qn("c:areaChart"): AreaSeries, |
| 247 | qn("c:barChart"): BarSeries, |
| 248 | qn("c:bubbleChart"): BubbleSeries, |
| 249 | qn("c:doughnutChart"): PieSeries, |
| 250 | qn("c:lineChart"): LineSeries, |
| 251 | qn("c:pieChart"): PieSeries, |
| 252 | qn("c:radarChart"): RadarSeries, |
| 253 | qn("c:scatterChart"): XySeries, |
| 254 | }[xChart_tag] |
| 255 | except KeyError: |
| 256 | raise NotImplementedError("series class for %s not yet implemented" % xChart_tag) |
| 257 | |
| 258 | return SeriesCls(ser) |
searching dependent graphs…