问题标签 [ios-charts]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
4743 浏览

ios - ios swift在图表中格式化数字

如何格式化图表折线图中显示的数据?默认情况下,数据显示为 double,但我希望它显示为 int。

在此处输入图像描述

0 投票
1 回答
886 浏览

swift - CGContextSetLineDash 警告

我正在尝试在我的应用程序中实现图形。我在我的应用程序中使用了这个图形库。它工作正常,但在控制台中显示以下警告 15-20 时间。

0 投票
2 回答
1946 浏览

ios - 在 ios-charts 条形图图例中有多个系列(标签)

我按照教程在我的项目中创建了一个图表。我成功地创建了图表,但是,我现在尝试使用两个不同的系列(或图例中的标签)对其进行初始化,以反映两种不同类型的数据(相当于折线图中有两条线)。我尝试使用一组数据集初始化图表的数据函数,但它不允许这样做。有人可以提供一些帮助吗?这是我的代码:

找到附上图表的图片(上面写着“已售出的单位”是我希望标签所在的位置)。图表

0 投票
3 回答
1422 浏览

ios - 使用 NSNumberFormatter 将秒转换为小时、分钟、秒

我正在使用 Charts 框架,因此我可以显示统计数据,它采用简单的数值,例如 1、5、17、99、1,574 等并将它们绘制在图表上。

它提供了设置选项以NSNumberFormatter更优雅地显示这些值。

我使用的数字是总秒数。例如 660 秒、1080 秒。

如何使用NSNumberFormatter使我的数字显示为小时、分钟、秒,而不是纯粹的总秒数?

0 投票
2 回答
841 浏览

ios - 如何为 iOS 中 DanielGindi(ChartsDemo) 给出的图表提供输入

我已将 danielGindi 在 github 中提供的 ChartsDemo swift 文件库导入到我的目标 c 文件中。现在我想通过提供输入值来检查图表。我是图表概念的新手。提前致谢!!!

0 投票
3 回答
921 浏览

ios - 添加 iOS 图表框架后 Xcode 项目无法构建(找不到 Info.plist)

我最近将 iOS-Charts 框架添加到我的 Xcode 项目中。该项目将在我将框架添加到我的项目之前构建,但之后不会。我什至还没有使用框架的任何功能,它没有在任何地方导入,我只是根据此处的说明将它添加到嵌入式二进制文件中。

构建失败消息:could not read data from .../AppName/Supporting Files/Info.plist': The file "Info.plist" couldn't be opened because there is no such file.

这没有任何意义,因为没有移动任何内容,并且如果我从嵌入式二进制文件部分删除框架,则项目确实会构建。

帮助将不胜感激,谢谢。

0 投票
2 回答
3780 浏览

ios - 在水平条形图中隐藏底部x轴?

我想使用不渲染任何 x 轴或网格线的 ios-charts 渲染(堆叠)水平条形图。我已经禁用了我能找到的所有设置,但底部的 x 轴仍然呈现。

此代码导致以下渲染:

仍然渲染 x 轴!!

如何删除底轴渲染和垂直值线?

0 投票
1 回答
1717 浏览

ios - 如何在使用 ios 图表的条形图中点击条形图时在条形图上显示值?

我正在尝试在点击 Bar 时像这样在气泡中显示选定的 bar 值。我已经chartView.drawMarkers = true;按照建议实现了,但是当我点击特定条时,它没有在气泡中显示值,如图所示。

请帮助我,我被困在这里。我的编码语言objective-c不是swift

0 投票
1 回答
1163 浏览

ios-charts - How to draw time based graphs using ios-charts

I'm trying to draw a temperature graph using iso-charts where the x axis data would be set from a server timestamp but the labels would be readable text.

For instance the graph x-axis label would start at Monday 00:00 and end Tuesday 12pm but the LineChartDataSet would be a collection of temperature (y-axis) and timestamps for the x

To display the timestamp I have a custom valueFormatter set as follow (which works great) lineChartView.xAxis.valueFormatter = timestampXAxisFormatter() //converts timestamp to Date string

My question: The LineChartDataSet seems to be indexed based which is causing some trouble: if I have 4 data points such as (9am, 10), (9:15am, 11), (12pm, 15), (1pm, 16) the 4 points are set in the chart at regular intervals (I was expecting 2 points to be on the left side of the graph and then last 2 points on the right side) - Is there a way to have a data set that is based on the x value instead of the index?

I saw ChartData has an init that takes an array of NSObjects but then it converts it to Strings...Thanks in advance for any suggestions you may have!

0 投票
1 回答
535 浏览

swift - Swift - Charts Framework - 如何隐藏/显示折线图?

我正在使用 Swift 的 Charts 框架。我将多个数据集绘制成散点图,以便在一个图表视图中有多条线/图。

我希望能够动态显示/隐藏这些图的任何组合,但不知道执行此操作的 API 命令(或者它是否存在)。

任何帮助将不胜感激。谢谢!