def set_value_axis(chart, max=None, min=None, is_second_axis=False): """ 2軸チャートの軸の最大値、最小値を設定する """ axis = ValueAxis(chart._chartSpace.valAx_lst[1 if is_second_axis else 0]) if max: axis.maximum_scale = float(max) if min: axis.minimum_scale = float(min)
def crosses_at_set_fixture(self, request): plotArea_cxml, new_value, expected_cxml = request.param plotArea = element(plotArea_cxml) valAx = plotArea.xpath('c:valAx[c:crossAx/@val="42"]')[0] value_axis = ValueAxis(valAx) expected_xml = xml(expected_cxml) return value_axis, new_value, plotArea, expected_xml
def crosses_set_fixture(self, request): plotArea_cxml, member, expected_cxml = request.param plotArea = element(plotArea_cxml) valAx = plotArea.xpath('c:valAx[c:crossAx/@val="42"]')[0] value_axis = ValueAxis(valAx) new_value = getattr(XL_AXIS_CROSSES, member) expected_xml = xml(expected_cxml) return value_axis, new_value, plotArea, expected_xml
def value_axis(self): """ The |ValueAxis| object providing access to properties of the value axis of this chart. Raises |ValueError| if the chart has no value axis. """ valAx_lst = self._chartSpace.valAx_lst if not valAx_lst: raise ValueError("chart has no value axis") idx = 1 if len(valAx_lst) > 1 else 0 return ValueAxis(valAx_lst[idx])
def category_axis(self): """ The category axis of this chart. In the case of an XY or Bubble chart, this is the X axis. Raises |ValueError| if no category axis is defined (as is the case for a pie chart, for example). """ catAx_lst = self._chartSpace.catAx_lst if catAx_lst: return CategoryAxis(catAx_lst[0]) dateAx_lst = self._chartSpace.dateAx_lst if dateAx_lst: return DateAxis(dateAx_lst[0]) valAx_lst = self._chartSpace.valAx_lst if valAx_lst: return ValueAxis(valAx_lst[0]) raise ValueError("chart has no category axis")
def minor_unit_set_fixture(self, request): valAx_cxml, new_value, expected_valAx_cxml = request.param value_axis = ValueAxis(element(valAx_cxml)) expected_xml = xml(expected_valAx_cxml) return value_axis, new_value, expected_xml
def minor_unit_get_fixture(self, request): valAx_cxml, expected_value = request.param value_axis = ValueAxis(element(valAx_cxml)) return value_axis, expected_value
def crosses_get_fixture(self, request): cxml, member = request.param valAx = element(cxml).xpath('c:valAx[c:crossAx/@val="42"]')[0] value_axis = ValueAxis(valAx) expected_value = getattr(XL_AXIS_CROSSES, member) return value_axis, expected_value