ios-charts

Chart viewport height increase when chart has no data plot on chart

眉间皱痕 提交于 2020-07-23 06:16:35
问题 I am using https://github.com/danielgindi/Charts library. When the chart has no data then chart height increased it should be the same as when the chart has data. Chart xAxis labels overlapped with char title. Any help would be appreciated. Code for chart setup var dataEntries: [ChartDataEntry] = [] axisFormatDelegate = self chartView.legend.form = .none let rightAxis = chartView.rightAxis rightAxis.enabled = false let yAxis = chartView.leftAxis let xAxisValue = chartView.xAxis xAxisValue

Chart viewport height increase when chart has no data plot on chart

独自空忆成欢 提交于 2020-07-23 06:15:25
问题 I am using https://github.com/danielgindi/Charts library. When the chart has no data then chart height increased it should be the same as when the chart has data. Chart xAxis labels overlapped with char title. Any help would be appreciated. Code for chart setup var dataEntries: [ChartDataEntry] = [] axisFormatDelegate = self chartView.legend.form = .none let rightAxis = chartView.rightAxis rightAxis.enabled = false let yAxis = chartView.leftAxis let xAxisValue = chartView.xAxis xAxisValue

how to draw a line graph in ios? Any control which will help me show graph data in ios

妖精的绣舞 提交于 2020-07-15 09:51:18
问题 I want to create a customized graph. Which will show on Y axis number of mathces e.g. 4 Y axis legends will be the starting date and ending date. And on X axis a line graph will plot the points on the status of the each match E.g. Win, Draw, Loss. How to do this in Objective C!?? 回答1: To create line graph just we need one UIBezier path and one CAShapeLayer, pass the co ordinate points based on the data you have to the UiBezierpath that will create the line graph then add that path to layer.

How to manually add marker in swift charts at fixed point

允我心安 提交于 2020-07-04 04:24:46
问题 I am using https://github.com/danielgindi/Charts I am trying to add marker manually on launch of Scatter graph. I am using chartView.highlightValue(x: 7, y: 9, dataSetIndex: 1, callDelegate: false) but gives different points on graph based on different type of data. What is relation of dataSetIndex here ? What i am looking for is to stick the marker on x: 7, y: 9 . Please suggest how can i achieve it? 来源: https://stackoverflow.com/questions/62343054/how-to-manually-add-marker-in-swift-charts

How to manually add marker in swift charts at fixed point

戏子无情 提交于 2020-07-04 04:24:46
问题 I am using https://github.com/danielgindi/Charts I am trying to add marker manually on launch of Scatter graph. I am using chartView.highlightValue(x: 7, y: 9, dataSetIndex: 1, callDelegate: false) but gives different points on graph based on different type of data. What is relation of dataSetIndex here ? What i am looking for is to stick the marker on x: 7, y: 9 . Please suggest how can i achieve it? 来源: https://stackoverflow.com/questions/62343054/how-to-manually-add-marker-in-swift-charts

cannot set custom colors for pie charts

蹲街弑〆低调 提交于 2020-06-27 16:58:12
问题 I am using iOS charts to make a pie chart, and I cannot figure out how to set the colors as custom colors with RGBA values. here is the code var colors: [UIColor] = [] colors.append(UIColor.init(red: 206, green: 173, blue: 128, alpha: 1)) colors.append(UIColor.init(red: 136, green: 169, blue: 132, alpha: 1)) colors.append(UIColor.init(red: 183, green: 73, blue: 32, alpha: 1)) colors.append(UIColor.init(red: 106, green: 152, blue: 150, alpha: 1)) colors.append(UIColor.init(red: 226, green: 120

How can I get `highlight.xPx` & `highlight.yPx` of the other lines which have same x point in iOS-Chart?

大城市里の小女人 提交于 2020-04-30 09:16:33
问题 I was able to achieve the plotting of lines on the graph using iOS-Charts. The x points are common for all the lines but the y points are different. When I move the cursor around the graph I want all the other circles also to move the with the single drag. So when I select any one of the x points amongst any 3 lines I want the highlight.xPx & highlight.yPx of other 2 lines as well. Here is an example let dysLineEntries: [ChartDataEntry] = [ChartDataEntry(x: 20.0, y: 120.0), ChartDataEntry(x:

iOS Charts remove decimal from yValues

血红的双手。 提交于 2020-03-18 07:07:26
问题 How to remove decimals from y values in iOS Charts? Im using the latest iOS Charts release with Swift3 回答1: Thanks for every one who tried to help, here was the fix, adding the below code let formatter = NumberFormatter() formatter.numberStyle = .none formatter.maximumFractionDigits = 0 formatter.multiplier = 1.0 chartData.valueFormatter = DefaultValueFormatter(formatter: formatter) to the setBarChartData func func setBarChartData(xValues: [String], yValues: [Double], label: String) { var

How to use xAxis with Label in Charts-frameworks

核能气质少年 提交于 2020-02-08 05:07:56
问题 As title,After I check How to add Strings on X Axis in iOS-charts? this post. I still don't know where can I put "formato.stringForValue(Double(i), axis: taxis)" in for-in loop, as I know, when I implement this protocol ,this function will send out a "String".My question is how does it connect to my xAxis data?? Following is my code ,please refer to it. //setChartData func setChart(dataPoints:[String],values:[Double]){ self.barChartView.noDataText = "You need to provide data for the chart."

How to set space between x axis labels in IOS Charts?

一曲冷凌霜 提交于 2020-01-23 03:44:06
问题 I have been facing this problem for a long time. I wish to set equal space between the x-axis labels in my ios chart. I referred to this solution and applied the code as lineChartView.xAxis.avoidFirstLastClippingEnabled = true , but it didn't work out. Then I did set the value to be false then it gave me somewhat equal spacing but now my first and last x-axis label is being hidden in the chart. Please help me out with this solution.Here is the code for the line chart customization: func