ios iPhone 有没有好的图表库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/769749/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 15:49:42  来源:igfitidea点击:

Is there a good charting library for iPhone?

ioscocoacocoa-touchchartscore-plot

提问by Mike Akers

I have a need to render and display charts (bar charts for now, but more types may be needed later) in an iPhone app I'm working on. I've done some looking around and it doesn't look like there are any really good, mature charting libraries for iPhone yet. I've also looked for something written for Cocoa on the Mac that can be adapted, but haven't found anything great yet.

我需要在我正在开发的 iPhone 应用程序中渲染和显示图表(现在是条形图,但以后可能需要更多类型)。我环顾四周,似乎还没有任何真正好的、成熟的 iPhone 图表库。我还在 Mac 上寻找了为 Cocoa 编写的可以改编的东西,但还没有找到任何好的东西。

Anybody dealt with this before? Any recommendations?

以前有人处理过这个吗?有什么建议吗?

I did find Core Plot, but it seems to be in the early stages of development.

我确实找到了Core Plot,但它似乎处于开发的早期阶段。

Edit to add some details of requirements (as they currently stand ;) )

编辑以添加一些要求的详细信息(按照目前的情况;))

  • Bar Charts
  • Horizontal bar charts
  • Double stacked bar charts
  • Axis labels (including rotated 90 degrees on the y axis)
  • Labels above each bar on the chart
  • Shaded or custom backgrounds
  • 条形图
  • 水平条形图
  • 双堆积条形图
  • 轴标签(包括在 y 轴上旋转 90 度)
  • 图表上每个条形上方的标签
  • 阴影或自定义背景

采纳答案by Barry Wark

One of the many factors that motivated the Core Plot project was the lackof good plotting frameworks on the iPhone. Core Plot also encompases many other use cases including desktop systems, but its design has included iPhone support from the beginning. It's getting pretty close to useable and is currently in use in several shipping iPhone and OS X applications.

推动 Core Plot 项目的众多因素之一是iPhone 上缺乏良好的绘图框架。Core Plot 还包含许多其他用例,包括桌面系统,但其设计从一开始就包括 iPhone 支持。它已经非常接近可用,目前已在多个出货的 iPhone 和 OS X 应用程序中使用。

Edit 2/10

编辑 2/10

Core Plot has come a long way since I first posted the summary. The framework now has bar charts (including horizontal bar charts, I believe), axis labels (including aribrarty rotations), and fills and backgrounds for graphs. I'm not sure about stacked bar charts, but it wouldn't be hard to add to the CPBarPlotclass that implements bar charts. As for annotations, there is a CPAnotationclass which you could subclass to add your annotations, if there isn't the exact functionality you need.

自从我第一次发布摘要以来,Core Plot 已经走了很长一段路。该框架现在有条形图(我相信包括水平条形图)、轴标签(包括任意旋转)以及图形的填充和背景。我不确定堆叠条形图,但添加到CPBarPlot实现条形图的类并不难。至于CPAnotation注释,如果没有您需要的确切功能,您可以将一个类子类化以添加注释。

Project on github.

github 上的项目。

回答by ColinE

As a commercial alternative to CorePlot, I'd recommend giving ShinobiControlsa go, they have some pretty good looking charts. They also have very good performance, rendering charts with 100,000+ points at 60fps and multi-touch support.

作为 CorePlot 的商业替代品,我建议尝试使用ShinobiControls,它们有一些非常漂亮的图表。它们还具有非常好的性能,以 60fps 的速度渲染 100,000 多个点的图表并支持多点触控。

As a full disclosure, I work for Scott Logic which is the parent company for ShinobiControls.

作为一个完整的披露,我为 ShinobiControls 的母公司 Scott Logic 工作。

回答by user8472

I have my own library called PowerPlotwhich is available under a dual-license model.

我有自己的名为PowerPlot的库,它在双许可模式下可用。

You can just follow the above link to install the demo app which shows off several sample charts. You can also download the GPL-version of the library and check out if it fits your needs. With the exception of horizontal bar charts it has the features requested - specifically, bar charts, stacked bar charts, various axis label positions and orientations.

您只需点击上面的链接即可安装演示应用程序,该应用程序展示了几个示例图表。您还可以下载该库的 GPL 版本并检查它是否符合您的需要。除水平条形图外,它还具有所需的功能 - 特别是条形图、堆积条形图、各种轴标签位置和方向。

回答by plusz

there is new, nice Pie Chart 3D library. 3D charts which you can rotate and scale with fingers + protocol for getting information about tapped slice

有新的、漂亮的饼图 3D 库。可以用手指旋转和缩放的 3D 图表 + 用于获取有关点击切片信息的协议

http://iphone.orpi.pl/?p=20

http://iphone.orpi.pl/?p=20

回答by JP Illanes

I needed a Radar Chart (or Spider web chart) and I couldn't find any, so I made my own implementation:

我需要一个雷达图(或蜘蛛网图),但找不到,所以我自己实现了:

RPRadarChart

RP雷达图

You are free to use it in whatever you want, if you do, let me know! I'll be slowly adding more features to it, if you want something specific ask me through github.

您可以随意使用它,如果您愿意,请告诉我!我会慢慢为它添加更多功能,如果你想要一些具体的东西,请通过 github 询问我。

回答by Marc Charbonneau

I went through my own search a year or two ago, and ended up making my own line graphing classes because I couldn't find anything that worked exactly the way I needed it to. The two big ones to look at though, are SM2DGraphViewand GraphX. I haven't tried either in an iPhone project, but I know SM2DGraphView is open source so you could modify it if needed.

一两年前我进行了自己的搜索,最终制作了自己的线图类,因为我找不到任何可以完全按照我需要的方式工作的东西。不过,要查看的两大类是SM2DGraphViewGraphX。我还没有在 iPhone 项目中尝试过,但我知道 SM2DGraphView 是开源的,因此您可以根据需要对其进行修改。

I've also considered using a WebView to use a JavaScript graphing library, but that's just a thought.

我还考虑过使用 WebView 来使用 JavaScript 图形库,但这只是一个想法。

回答by Julien Chastang

You can theoretically use the Google Chart APIalong with a Cocoa wrapper. This could be a light-weight solution.

理论上,您可以将Google Chart APICocoa 包装器一起使用。这可能是一个轻量级的解决方案。

回答by yonel

This one seems ok as well

这个好像也不错

s7graphview

s7graphview

(but never tried it really).

(但从未真正尝试过)。