Android:创建动态频率(正弦)图

发布于 2024-12-25 19:40:21 字数 363 浏览 0 评论 0原文

我如何在android中创建动态频率图? 像这样: http://www.jazzitalia.net/lezioni/sax/immagini/ grafico1.gif 没有轴。 我有像这样的图表所需的相位、幅度和正常数据。 我找到了这个例子: http://androidplot.com/wiki/A_Dynamic_XYPlot 但我没有知道这是否是执行此操作的完美方法...

how can i create a dynamic frequency graph in android?
like this: http://www.jazzitalia.net/lezioni/sax/immagini/grafico1.gif without axes.
i have the phase, the amplitude, the normal data that is needed for a graph like this.
I've found this example: http://androidplot.com/wiki/A_Dynamic_XYPlot but i don't know if it's the perfect way to do this thinks...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

看透却不说透 2025-01-01 19:40:21

动态图示例是您想要的一个非常好的起点。更改 GetY 和 Runnable,使其按照您想要的方式处理数据。

至于图形的样式,您可以通过将 null 传递给 LineAndPointFormatter 上的适当参数来关闭填充和点。

下面的代码展示了如何在您不需要时关闭各种视觉功能。它已作为 TimedXyPlotExample 与源签入,但尚未发布。

    if (!mBackgroundOn) {
        // remove the background stuff.
        mDynamicPlot.setBackgroundPaint(null);
        mDynamicPlot.getGraphWidget().setBackgroundPaint(null);
        mDynamicPlot.getGraphWidget().setGridBackgroundPaint(null);
    }

    if (!mKeyOn)
        mDynamicPlot.getLayoutManager()
                .remove(mDynamicPlot.getLegendWidget());
    if (!mDomainLabelOn)
        mDynamicPlot.getLayoutManager().remove(
                mDynamicPlot.getDomainLabelWidget());
    if (!mDomainAxisOn) {
        mDynamicPlot.getGraphWidget().setDomainLabelPaint(null);
        mDynamicPlot.getGraphWidget().setDomainOriginLabelPaint(null);
    }
    if (!mBoarderOn)
        mDynamicPlot.setDrawBorderEnabled(false);
    if (!mRangeLabelOn)
        mDynamicPlot.getLayoutManager().remove(
                mDynamicPlot.getRangeLabelWidget());
    if (!mRangeAxisOn) {
        mDynamicPlot.getGraphWidget().setRangeLabelPaint(null);
        mDynamicPlot.getGraphWidget().setRangeOriginLabelPaint(null);
    }
    if (!mGridOn) {
        mDynamicPlot.getGraphWidget().setGridLinePaint(null);
        mDynamicPlot.getGraphWidget().setDomainOriginLinePaint(null);
        mDynamicPlot.getGraphWidget().setRangeOriginLinePaint(null);
    }
    if (!mTitleOn) 
        mDynamicPlot.getLayoutManager().remove(mDynamicPlot.getTitleWidget());

The dynamic plot example is a very good starting point for what you want. Change GetY and the Runnable to make it do the data the way you want it.

As for the style of the graph you can switch thhe fill off and the points off by passing in null to the apripriate parrameter on the LineAndPointFormatter.

Here is code to show how to switch various visual features off if you don't want them. It's checked in with the source as TimedXyPlotExample but has not made it into a release yet.

    if (!mBackgroundOn) {
        // remove the background stuff.
        mDynamicPlot.setBackgroundPaint(null);
        mDynamicPlot.getGraphWidget().setBackgroundPaint(null);
        mDynamicPlot.getGraphWidget().setGridBackgroundPaint(null);
    }

    if (!mKeyOn)
        mDynamicPlot.getLayoutManager()
                .remove(mDynamicPlot.getLegendWidget());
    if (!mDomainLabelOn)
        mDynamicPlot.getLayoutManager().remove(
                mDynamicPlot.getDomainLabelWidget());
    if (!mDomainAxisOn) {
        mDynamicPlot.getGraphWidget().setDomainLabelPaint(null);
        mDynamicPlot.getGraphWidget().setDomainOriginLabelPaint(null);
    }
    if (!mBoarderOn)
        mDynamicPlot.setDrawBorderEnabled(false);
    if (!mRangeLabelOn)
        mDynamicPlot.getLayoutManager().remove(
                mDynamicPlot.getRangeLabelWidget());
    if (!mRangeAxisOn) {
        mDynamicPlot.getGraphWidget().setRangeLabelPaint(null);
        mDynamicPlot.getGraphWidget().setRangeOriginLabelPaint(null);
    }
    if (!mGridOn) {
        mDynamicPlot.getGraphWidget().setGridLinePaint(null);
        mDynamicPlot.getGraphWidget().setDomainOriginLinePaint(null);
        mDynamicPlot.getGraphWidget().setRangeOriginLinePaint(null);
    }
    if (!mTitleOn) 
        mDynamicPlot.getLayoutManager().remove(mDynamicPlot.getTitleWidget());
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文