本文整理了Java中com.twosigma.beakerx.chart.xychart.plotitem.YAxis
类的一些代码示例,展示了YAxis
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YAxis
类的具体详情如下:
包路径:com.twosigma.beakerx.chart.xychart.plotitem.YAxis
类名称:YAxis
[英]YAxis
[中]亚克斯
代码示例来源:origin: twosigma/beakerx
@Override
public void serialize(YAxis yAxis, JsonGenerator jgen, SerializerProvider sp)
throws IOException, JsonProcessingException {
jgen.writeStartObject();
jgen.writeObjectField(TYPE, SerializerUtil.getTypeName(yAxis));
jgen.writeObjectField("label", yAxis.getLabel());
jgen.writeObjectField("auto_range", yAxis.getAutoRange());
jgen.writeObjectField(AUTO_RANGE_INCLUDES_ZERO, yAxis.getAutoRangeIncludesZero());
jgen.writeObjectField("lower_margin", yAxis.getLowerMargin());
jgen.writeObjectField("upper_margin", yAxis.getUpperMargin());
jgen.writeObjectField("lower_bound", yAxis.getLowerBound());
jgen.writeObjectField("upper_bound", yAxis.getUpperBound());
jgen.writeObjectField("use_log", yAxis.getLog());
jgen.writeObjectField("log_base", yAxis.getLogBase());
jgen.writeEndObject();
}
代码示例来源:origin: twosigma/beakerx
public AbstractChart setyAutoRange(boolean yAutoRange) {
this.yAxis.setAutoRange(yAutoRange);
sendModelUpdate(ChartToJson.serializeAutoRange(this.yAxis.getAutoRange()));
return this;
}
代码示例来源:origin: twosigma/beakerx
public AbstractChart setYAutoRangeIncludesZero(boolean yAutoRangeIncludesZero) {
this.yAxis.setAutoRangeIncludesZero(yAutoRangeIncludesZero);
sendModelUpdate(ChartToJson.serializeAutoRangeIncludesZero(this.yAxis.getAutoRangeIncludesZero()));
return this;
}
代码示例来源:origin: twosigma/beakerx
static Map<Object, Object> serializeYBound(YAxis yAxis) {
Map<Object, Object> value = new LinkedHashMap<>();
value.put(Y_LOWER_BOUND, yAxis.getLowerBound());
value.put(Y_UPPER_BOUND, yAxis.getUpperBound());
return value;
}
代码示例来源:origin: twosigma/beakerx
public AbstractChart setYLabel(String yLabel) {
yAxis.setLabel(yLabel);
sendModelUpdate(ChartToJson.serializeYLabel(this.yAxis.getLabel()));
return this;
}
代码示例来源:origin: twosigma/beakerx
@Test
public void createYAxisWithOneStringAndTwoDoubleParams_hasLabelAndMarginsValues() {
//when
YAxis yAxis = new YAxis("string param", 1, 2);
//then
Assertions.assertThat(yAxis.getLabel()).isEqualTo("string param");
Assertions.assertThat(yAxis.getLowerMargin()).isEqualTo(1);
Assertions.assertThat(yAxis.getUpperMargin()).isEqualTo(2);
}
代码示例来源:origin: twosigma/beakerx
@Test
public void setBoundsWithTwoDoubleParams_hasBoundsValuesAndHasAutoRangeIsFalse() {
//given
YAxis yAxis = new YAxis();
//when
yAxis.setBound(1, 2);
//then
Assertions.assertThat(yAxis.getAutoRange()).isEqualTo(false);
Assertions.assertThat(yAxis.getLowerBound()).isEqualTo(1);
Assertions.assertThat(yAxis.getUpperBound()).isEqualTo(2);
}
代码示例来源:origin: twosigma/beakerx
@Test
public void clone_shouldCloneYAxis() throws CloneNotSupportedException {
//given
YAxis yAxis = new YAxis();
//when
yAxis.setLabel("clone");
YAxis cloneYaxis = (YAxis) yAxis.clone();
yAxis.setLabel("original");
//then
Assertions.assertThat(cloneYaxis.getLabel()).isEqualTo("clone");
Assertions.assertThat(yAxis.getLabel()).isEqualTo("original");
}
代码示例来源:origin: twosigma/beakerx
@Test
public void leftShiftWithListParam_shouldAddYAxes() {
//given
AbstractChart chart =createWidget();
//when
chart.leftShift(Arrays.asList(new YAxis("axis1"), new YAxis("axis2")));
//then
assertThat(chart.getYAxes().get(1).getLabel()).isEqualTo("axis1");
}
代码示例来源:origin: twosigma/beakerx
public AbstractChart setyUpperMargin(double margin) {
this.yAxis.setUpperMargin(margin);
sendModelUpdate(ChartToJson.serializeUpperMargin(this.yAxis.getUpperMargin()));
return this;
}
代码示例来源:origin: twosigma/beakerx
public AbstractChart setYBound(double lower, double upper) {
this.yAxis.setAutoRange(false);
this.yAxis.setBound(lower, upper);
sendModelUpdate(ChartToJson.serializeYBound(this.yAxis));
return this;
}
代码示例来源:origin: twosigma/beakerx
public AbstractChart setyLowerMargin(double margin) {
this.yAxis.setLowerMargin(margin);
sendModelUpdate(ChartToJson.serializeYLowerMargin(this.yAxis.getLowerMargin()));
return this;
}
代码示例来源:origin: twosigma/beakerx
public double getYUpperMargin() {
return this.yAxis.getUpperMargin();
}
代码示例来源:origin: twosigma/beakerx
public Double getYUpperBound() {
return this.yAxis.getUpperBound();
}
代码示例来源:origin: twosigma/beakerx
public Boolean getyAutoRange() {
return this.yAxis.getAutoRange();
}
代码示例来源:origin: twosigma/beakerx
public double getYLowerMargin() {
return this.yAxis.getLowerMargin();
}
代码示例来源:origin: twosigma/beakerx
public Double getYLowerBound() {
return this.yAxis.getLowerBound();
}
代码示例来源:origin: twosigma/beakerx
public String getYLabel() {
return yAxis.getLabel();
}
代码示例来源:origin: twosigma/beakerx
@Test
public void serializeLabelOfYAxis_resultJsonHasLabel() throws IOException {
//when
yAxis.setLabel("some label");
yAxisSerializer.serialize(yAxis, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
//then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("label")).isTrue();
Assertions.assertThat(actualObj.get("label").asText()).isEqualTo("some label");
}
代码示例来源:origin: twosigma/beakerx
@Test
public void serializeAutoRangeIncludesZeroOfYAxis_resultJsonHasAutoRangeIncludesZero()
throws IOException {
//when
yAxis.setAutoRangeIncludesZero(true);
yAxisSerializer.serialize(yAxis, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
//then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("auto_range_includes_zero")).isTrue();
Assertions.assertThat(actualObj.get("auto_range_includes_zero").asBoolean()).isTrue();
}
内容来源于网络,如有侵权,请联系作者删除!