1

First i give my View show below. and give some explanation:enter image description here

In my ViewGroup i have two GraphicalView, each of them share the same size space. Let's just call the chart above chartA and below one chartB.

Then i have some questions:

  1. If i make a move a movement on chartA ,how could i make the chartB move just as my finger moving on chartB?
  2. If i pinch on chartA can also chartB change auto?
  3. I want to add some callback function to some points? Does ACE supports this?
  4. I do not want to show numbers negative while user pinching.How can I make this point?

Last is my chart code:

mDataset.addSeries(series);
PointStyle style = PointStyle.CIRCLE;
renderer = buildRenderer(lineColor, style, true);
setChartSettings(renderer, "X", "Y", 0, 50, yMin, yMax, Color.WHITE,
                 Color.WHITE, title,chartColor);
GraphicalView chart = ChartFactory.getLineChartView(context, mDataset, renderer);
layout.addView(chart, new LayoutParams(LayoutParams.MATCH_PARENT,
                                       LayoutParams.MATCH_PARENT));
HashMap map = new HashMap();

and the renderer:

protected XYMultipleSeriesRenderer buildRenderer(int color,
                                                 PointStyle style,
                                                 boolean fill) {
    XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();

    XYSeriesRenderer r = new XYSeriesRenderer();
    r.setColor(color);
    r.setPointStyle(style);
    r.setFillPoints(fill);
    r.setLineWidth(3);
    renderer.addSeriesRenderer(r);
    return renderer;
}

I random all the data i want.

4

1 回答 1

1
  1. PanListener您必须在您的chartA和每个事件上注册 a panApplied,只需执行:rendererB.setXAxisMin(rendererA.getXAxisMin());对于 max X 和 Y 轴也是如此,然后调用chartB.repaint();
  2. 与上面相同,只是您需要添加一个ZoomListener.
  3. 您可以设置点击监听器:chartA.setOnClickListener();
  4. 请重新表述为一个单独的问题。

此外,请参阅代码,向您展示如何使用上述 API。

于 2013-06-04T12:33:41.333 回答