作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
任何人都可以帮助我进行下面的缩放!在进行水平缩放时,我想增加并显示间隙或范围。
现在附加链接上的范围是 10,12,14,16... 缩放时应显示为 10,11,12,13,...我如何在缩放时增加这个域范围。请指导我。
最佳答案
protected 静态 int gapValue;//两个日期之间的差距
private void zoom(PointF source, double startDistance, double endDistance) {
Plot plot = this.chart.getPlot();
PlotRenderingInfo info = this.info.getPlotInfo();
if (plot instanceof Zoomable) {
float scaleDistance = (float) (startDistance / endDistance);
//for maintaining the limit of zooming range horizontally
if (this.mScale * scaleDistance <= 1.0f
&& this.mScale * scaleDistance > 0.1f) {
this.mScale *= scaleDistance;
Zoomable z = (Zoomable) plot;
z.zoomDomainAxes(scaleDistance, info, source, false);
int sealValue = (int) (gapValue * this.mScale);
// gap shoud be greater than zero
if (sealValue == 0)
sealValue = 1;
// To re-render the graph dates in domain axis
((DateAxis) this.getChart().getXYPlot().getDomainAxis())
.setTickUnit(new DateTickUnit(DateTickUnitType.DAY,
sealValue, new SimpleDateFormat("MM/dd")));
}
}
// repaint
invalidate();
关于android - Afree图表: How to increase X axis values(gap or domain range) while zooming,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24407290/
在 Address Arithmetic 一章中,函数 afree 定义如下: static char allocbuf[ALLOCSIZE]; // storage for alloc static
我是一名优秀的程序员,十分优秀!