-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making X-Values Properly Scaled (Not Equidistant) #194
Comments
are you saying they are equal distance on xAxis currently, and you want xAxis behave like yAxis? |
Hi Xuan, Yes. The 3 points are the same distance apart on the x axis. Therefore, the graph of Best,
|
Great, I have been the first (I guess) person to ask for this feature. I have filed the request for both Android and iOS, however no response yet... I hope more and more people can realize this is an important feature for professional users. @PhilJay and @danielgindi I think we are aiming at providing the world-class charts. I would love to help on this, however, I cannot see the whole picture for all the features inside the projects. You guys have better understanding on it. From what I have tried, render xAxis like yAxis is not the tough part, what blocks me is the xAxis labels is not in the right place while zooming and scaling. I still don't get how to correctly render the labels, considering the label width and the position. |
FYI, #176 and PhilJay/MPAndroidChart#821 is the same request I have been filed. |
This is becoming a popular feature, we know. It is quite complex to implement and we haven't got to designing it yet... |
"Soon" meaning when I get the time to sit a whole night on it. I have a wedding to plan at the moment so you can see I'm a little less active here :-) |
@danielgindi HUGE congratulations to you from China! |
Can you give us a rough idea of when this might be implemented? And congratulations! |
@aaga I think it takes a lot of time, since the logic is very different and lots of things to think about and re-write. Could be months even if it has a high priority. |
+1 for this feature |
Hi, I am new in iOS, working with swift. I am using this beautiful charts library. I'm making a line chart with the dates on x axis and unable to plot properly scaled points(Dates). Tried with passing NSDates to xVals. I don't know what is wrong with the way I am doing .... plz help me out. |
You can convert your dates to time intervals to use as X values. Then you can format the time interval back to dates to display on the X axis. |
@petester42 @shrikantwalekar-tudi but note that subsequent x-axis data points will be represented equidistantly even if the time interval between the data points is not equidistant. Hence I think we can interpret the comment @shrikantwalekar-tudip made as: +1 |
In not sure I understand. |
Can anyone help me with this please!!! Any help will be appreciated! Thank you!!! |
It's very impontant |
+1 for me, this feature would be REALLY a breakthrough |
+1 |
+1 for me too |
+1 |
1 similar comment
+1 |
I need this too, but for now, what is the appropriate workaround to change the x-axis values for non-regular time-series data? I.e., if I have (4/25, 5) What data can I use to create a graph that appropriately displays the amount of time between each data point so that the 7/4 data point shows as ~60 days away from the previous data point instead of showing as 1 day away. Does something like this work: (4/25, 5) I've tried playing around with this, but I get errors when the number of xVals is not equal to the number of yVals. |
when you don't have y value for the xIndex, simply not insert y values into the array |
Sorry repository mixup :-) |
@PhilJay that's great news! I'm just trying out this library for the first time, but since my use-case is time-series data, I really need this to get things working |
I'm working on migrating the beta-changes from the Android repo, and it will be available soon :-) |
Does this migration include all new features of 3.0 including the scattered x values?
|
Good to see that this feature was already requested and that work has been done on it. I anxiously await for the solution since I love this library but I cannot use it in my apps unless the charts are properly proportioned in the X axis. |
I believe it's coming out soon, has been a lonnnnng time! |
I can't wait for this feature to be available, I really need it as my app uses a time based X axis. |
@danielgindi thank you for your great work! Have you had a chance to migrate the android changes to enable this feature? Can how to use this feature? Thanks again! |
there is a branch already. However still under bug fix |
@liuxuan30 which branch is that? 3.0? |
@rlimberger v3 branch |
Thank you. Is there an example on how to use this feature (irregular x spacing and different x values for different datasets)? |
@rlimberger It should be similar approach. You could check out v3 branch to see if there is a ChartsDemo example (sorry I don't have time to check out right now) |
The Objc demo works well enough to provide a good demonstration of the capabilities of v3. Thanks @liuxuan30! By the way, is it possible to make the scatter chart with a line connecting the points (a different line for each data set)? Unlike the Multiple Lines Chart demo, the Scatter Chart demo seems to show an independent set of x values for each data set, which is exactly what I want. However, I would like all of the points in each data set connected by a separate line. |
never mind; I found the answer to my own question. Both LineChartDataSet and ScatterChartDataSet are initialized with an array of ChartDataEntry objects, each of which can have a completely independent (x,y) set. Awesome! |
Yeah, awesome :-) This issue is going to be closed now (yay!!!) |
My code now crashes with the message "'NSInvalidArgumentException', reason: '-[Charts.ChartDataEntry encodeWithCoder:]: unrecognized selector sent to instance...'" when executing NSKeyedArchiver.archivedData(withRootObject:) with an argument of type ChartDataEntry. This didn't happen before. Is it possible that it is due to a bug in v3? |
Never mind. It's not a bug in v3 that caused my code to crash. I just had to re-add conformance of the ChartDataEntry class to NSCoding. |
Anyone else getting this error: "Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API" |
The backtrace indicates: ": CGContextAddLineToPoint: no current point." |
y and x axis values are not set properly.
//Y-axis
|
Hi, I'm making a line chart with the following example data points:
(0,0)
(1,0)
(5,0)
Is there a way I can get the 3 points to show up so that they're scaled properly? Right now, if I add a Data Set with 2 arrays, all 3 points are the same distance from each other. I know there's a thread about this in MPAndroidCharts, but I was wondering if anyone's figured out how to do this in iOS. Thank you so much!
The text was updated successfully, but these errors were encountered: