本文整理汇总了Python中openpyxl.writer.charts.BarChartWriter.write方法的典型用法代码示例。如果您正苦于以下问题:Python BarChartWriter.write方法的具体用法?Python BarChartWriter.write怎么用?Python BarChartWriter.write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openpyxl.writer.charts.BarChartWriter
的用法示例。
在下文中一共展示了BarChartWriter.write方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_serialised
# 需要导入模块: from openpyxl.writer.charts import BarChartWriter [as 别名]
# 或者: from openpyxl.writer.charts.BarChartWriter import write [as 别名]
def test_serialised(self, bar_chart_2):
"""Check the serialised file against sample"""
cw = BarChartWriter(bar_chart_2)
xml = cw.write()
tree = fromstring(xml)
chart_schema.assertValid(tree)
expected_file = os.path.join(DATADIR, "writer", "expected", "BarChart.xml")
with open(expected_file) as expected:
diff = compare_xml(xml, expected.read())
assert diff is None, diff
示例2: test_serialised
# 需要导入模块: from openpyxl.writer.charts import BarChartWriter [as 别名]
# 或者: from openpyxl.writer.charts.BarChartWriter import write [as 别名]
def test_serialised(self, bar_chart, datadir):
"""Check the serialised file against sample"""
cw = BarChartWriter(bar_chart)
xml = cw.write()
tree = fromstring(xml)
chart_schema.assertValid(tree)
datadir.chdir()
with open("BarChart.xml") as expected:
diff = compare_xml(xml, expected.read())
assert diff is None, diff