Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 29 21:06
    alimumtaz commented #3772
  • Jun 29 14:29
    eliakorkmaz commented #4835
  • Jun 29 14:25
    pmairoldi commented #4836
  • Jun 29 13:20
    lchamp commented #4836
  • Jun 28 14:41
    waterskier2007 commented #4845
  • Jun 28 10:36
    artalejo commented #4829
  • Jun 27 14:05
    artalejo commented #4829
  • Jun 27 08:04
    eliakorkmaz commented #4835
  • Jun 25 08:37
    EzioChen commented #3928
  • Jun 23 15:06
    eliakorkmaz commented #4836
  • Jun 23 13:04
    Xcode123456 opened #4852
  • Jun 23 12:47
    willychang21 edited #4851
  • Jun 23 12:14
    eliakorkmaz reopened #4836
  • Jun 23 12:14
    eliakorkmaz closed #4836
  • Jun 23 12:14
    eliakorkmaz commented #4836
  • Jun 23 07:10
    lchamp commented #4835
  • Jun 23 07:10
    lchamp commented #4838
  • Jun 23 06:20
    willychang21 edited #4851
  • Jun 23 04:23
    willychang21 edited #4851
  • Jun 23 04:09
    willychang21 edited #4851
Xuan
@liuxuan30
@danielgindi please add @jjatie in ChartRealm as well :)
Pierre-Marc Airoldi
@petester42
Move the repos to an org!
James Sayer
@jsayer7_twitter
Is there a reference document for this project? I'm looking to integrate Charts into my app. However, my data values are strings and integers, and can't seem anything online that would say this is supported
James Sayer
@jsayer7_twitter
For instance, I have weather data for the next hour..My X Axis is actually a date (can be a string even, just not a double), and I have an array of precipitation probabilities (can be either string or doubles). I can't seem to get this data to display
Because it complains that the times are not doubles
Pierre-Marc Airoldi
@petester42
The key to doing something like this is that you used doubles for points on a graph but you give formatted labels to you points. For example a formatted date can be displayed as label but the actual point on the graph is an integer of time since 1970.
James Sayer
@jsayer7_twitter
Thank you Pierre-Marc! Is there a guide or tutorial anywhere for formatting this?
the only tutorials I can find online are using int based strings such as "150" and "2". Pretty simple to get the double value of that
Pierre-Marc Airoldi
@petester42
I think there might be a demo using it but I don’t know which one off the top of my head.
James Sayer
@jsayer7_twitter
`public func stringForValue(_ value: Double, axis: AxisBase?) -> String {
let date = Date(timeIntervalSince1970: value)
let components = Calendar.current.dateComponents([.hour, .minute], from: date)
    guard let hour = components.hour, let minute = components.minute else {
        return ""
    }
    let hourString = String(describing: hour)
    let minuteString = String(describing: minute)
`
Something like that?
then return a string with those two strings formatted?
Pierre-Marc Airoldi
@petester42
Ya something like that.
James Sayer
@jsayer7_twitter
Thanks, I'll see what i can do. The documentation for the formatting of the axis is not very clear
Pierre-Marc Airoldi
@petester42
If the documentation is really not clear please open an issue with suggestions of how to make it better. Or even better create a pull request updating them!
James Sayer
@jsayer7_twitter
I figured it out, I just had to wrap my head around the formatting!
Thank you Pierre for the help! I was curious if there was a way to hide the labels above a value in a line chart? I have a graph displaying the weather information for the next 60 minutes. I'm running into scenarios where the entries are so close together that the labels are overlapping
Pierre-Marc Airoldi
@petester42
Maybe if you return null for the formatting for the points you want to skip. I’m not too sure though. Maybe someone else has a better insight.
Parag Dulam
@paragdulam

hi guys, i am working on the bar chart of charts library. but the chart gets selected even i tap outside the chart. i checked the link below which has older version of swift implemented and am looking for how can it be done in swift 4?

https://stackoverflow.com/questions/40232200/charts-get-selected-bar-data-only-when-tapped-inside-the-bar?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

Seth Bromberger
@sbromberger

hi all - is there a way to use Charts with spm? I've tried

    dependencies: [
        .package(url: "https://github.com/danielgindi/Charts.git", from: "3.1.1")
    ],

and gotten

Dependencies: 
    https://github.com/danielgindi/Charts.git @ 3.1.1..<4.0.0
'ChartsDemo' /Users/seth/dev/swift/ChartsDemo: error: product dependency 'Charts' not found
#2950 suggests this should work.
HamGuy
@HamGuy
Dose anyone could help me with this issue? danielgindi/Charts#2504
Pierre-Marc Airoldi
@petester42
I answered in the issue. Hope it helps. I’ll reply there if you still have issues.
HamGuy
@HamGuy
@petester42 thanks for the reply, i had updated my question in the issue.
M.Awais Fayyaz
@AwaisFayyaz
Hi every one.

I am trying to show positive as well as negative values in a bar chart. I . I am using charts 3.1 on xcode 9.4.1. Can anybody tell me how to acheive it. This answer suggests to set logical values and use formatter for showing values as negative.

But i don't know how to set logical values and use formatter for displaying neg values.

Any help would be much appreciated.

Thanks

Pierre-Marc Airoldi
@petester42
I don’t think I quite understand could you please provide an example dataset for the chart you’re trying to create?
M.Awais Fayyaz
@AwaisFayyaz
@petester42 . Thanks for the reply. Currently, can you help me with this comment?
I am trying to set fixed intervals for y axis.
Peter Stenger
@reteps
Hello everyone! I am trying to resize the chart boundaries based on which datasets are visible. I poked around and found lowestVisibleX and highestVisibleY. would I use these to resize the chart boundaries in the X direction?
Peter Stenger
@reteps
update: it did not work.
Victor Monteiro
@victorvmz21
hey guys ..
I need a help.
I am trying to use barChart pod
and this error message apperas
appears*
BarChartView?' has no member 'descriptionT
descriptionText
what should I substitute this property descriptionText?
Pierre-Marc Airoldi
@petester42
I think what you’re looking for is chartDescription
Victor Monteiro
@victorvmz21
yes....
thanks it works
danwguy
@danwguy
Howdy, I am kinda new to iOS. I'm an android developer. I have been using the MPAndroidCharts in android for a while and have a good feel for it, but I am running into an issue with the iOS version. I am trying to follow the tutorial for updating the data in a chart but the examples show using dataSet.replaceEntries I can't seem to find that method. It doesn't exist. I pulled the master branch and imported into my Xcode project, but I can't replace the values in the chartData
I read through some documentation and it looks like that change is in 3.3 but master is on 3.2. Is there a way to get 3.3 or is there a way to replace the values in the ChartDataSet in 3.2?
Pierre-Marc Airoldi
@petester42
Just set the data on the chart again.
It should update.
danwguy
@danwguy
When I do that the chart doesn't redraw. I have tried using chartView.data?.notifyDataSetChanged() and chartView.notifyDataSetChanged(), but the chart data doesn't update
I have a SegmentControl that has 2 values 7 days and 21 days, on changing it I change a var chartMode from 7 to 21, then call my setChartData function which loads data from CoreData based on the chartMode. However when clicking it I am still only seeing 7 days, it doesn't change the chart to 21 days. I know the SegmentControl is working, but the chart doesn't update with new data