-
Notifications
You must be signed in to change notification settings - Fork 653
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
V2 version of SwiftUI ChartView #89
base: master
Are you sure you want to change the base?
Conversation
I believe this will break a lot of other PR. But looks cleaner, and easier so I don't mind adapting my PR. |
@AppPear With this in the works, should people hold off on PRs? Do you want to open up issues to break up this change and get help implementing it? |
To participate in the new branch, how the best way to do it? |
Yes, please fork it and create a PR for the Thanks! |
ok, I'll try working on the PieChart, but no promises;(. |
Maybe we could create chat somewhere to coordinate. |
@AppPear I love the philosophy re: building the charts w/ the bare minimum and building upon it. One suggestion I have is writing unit tests to go along with committed code, rather than treating it as an afterthought. I'll take a peek at code coverage and see what I can unearth that's testable. |
- write unit tests for CGPoint+Extension.swift - clean up formatting on CGPoint+Extension.swift
Looking forward to this!! |
* Add ColorGradient example Add ColorGradient single color constructor Add preview for BarChart * Add PieChart Allow multi color for Pie and Bar Add linter
Thanks, I merged it! Only small issue was |
The extension file wasn't in my commit;( sorry. |
Fix for making text work with both Dark/Light mode. Also solves line chart background to appear white in dark mode
Tried out the Beta and it is looking pretty cool. How close is this to getting released? |
Co-authored-by: Dan Wood <danwood@users.noreply.github.com>
* Starting on filling in documentation. * First pass on most/all files * more descriptions filled in * Some documentation but TBH the author would be better suited to explain how this works! * more basic stuff filled in * Add a description and bunch of discussion text for most of the view `body` declarations * more explanations Co-authored-by: Dan Wood <danwood@users.noreply.github.com>
Co-authored-by: Dan Wood <danwood@users.noreply.github.com>
* Add PieChart interaction PR changes to v2 * Add custom string format for ChartLabel when interactionInProgress = true (#151) * Dark/Light mode fixes (#148) Fix for making text work with both Dark/Light mode. Also solves line chart background to appear white in dark mode * Add custom string format for ChartLabel when interactionInProgress = true Co-authored-by: Sagar Patel <s.72427patel@gmail.com> * Prepare charts to display x and y values souch as a value for a given point Co-authored-by: Roddy Munro <roddymunro@icloud.com> Co-authored-by: Sagar Patel <s.72427patel@gmail.com>
Waiting for the release😁 |
In my widget i import SwiftUICharts. 2.0.0-beta.1,and my code import SwiftUICharts ............... struct TestWidgetView : View {
} and run,the errors: Showing Recent Messages Undefined symbol: nominal type descriptor for SwiftUICharts.LineChart Undefined symbol: nominal type descriptor for SwiftUICharts.ChartData Undefined symbol: nominal type descriptor for SwiftUICharts.ChartValue Undefined symbol: protocol conformance descriptor for SwiftUICharts.LineChart : SwiftUI.View in SwiftUICharts Undefined symbol: SwiftUICharts.ColorGradient.init(SwiftUI.Color, SwiftUI.Color) -> SwiftUICharts.ColorGradient Undefined symbol: SwiftUICharts.ChartColors.orangeDark.unsafeMutableAddressor : SwiftUI.Color Undefined symbol: type metadata accessor for SwiftUICharts.ChartStyle Undefined symbol: SwiftUICharts.LineChart.init() -> SwiftUICharts.LineChart Undefined symbol: type metadata for SwiftUICharts.ColorGradient Undefined symbol: SwiftUICharts.ChartColors.orangeBright.unsafeMutableAddressor : SwiftUI.Color Undefined symbol: type metadata for SwiftUICharts.LineChart Undefined symbol: protocol witness table for SwiftUICharts.LineChart : SwiftUICharts.ChartBase in SwiftUICharts Undefined symbol: SwiftUICharts.ChartStyle.__allocating_init(backgroundColor: SwiftUI.Color, foregroundColor: [SwiftUICharts.ColorGradient]) -> SwiftUICharts.ChartStyle Undefined symbol: (extension in SwiftUICharts):SwiftUI.View< where A: SwiftUICharts.ChartBase>.data([Swift.Double]) -> some Undefined symbol: (extension in SwiftUICharts):SwiftUI.View.chartStyle(SwiftUICharts.ChartStyle) -> some |
@kakashilw isn't this line: var body: some SwiftUI.View { Supposed to be var body: some View { |
Hi, |
I actually tried importing this and using it in Widget, but it draws blank on both the preview and simulator. ANyone able to get it working? |
@kevinmun yes, it works in my application. |
I see, I tested it out again, and it seems, it's ok if it's deployed to device. Somehow on preview / simulator, it appears as blank. Weird. |
hey, is the v2 still being worked on or is this library not maintained anymore? |
Yes, currently I'm on organising a bigger help to maintain and take this lib to next level and release v2 as soon as possible |
@AppPear I'd like to join as a member. I currently have a candlestick chart working using the new-version branch on my machine. I'm interested in helping out. I like to chat about data structure for support of that type of chart and others. |
Can you please join the slack channel? |
@AppPear |
Thank for the answer. |
now it is possible to add background lines precisely as charts are displayed at correct size also rewrote basics to conform with Shapes and Animatable protocol
Hello! How's V2 going? Anything we can help? |
* feat: add linechart interaction point * feat: add ability to show current data point on linechart
* feat: new protocol for chained functions, and added support for explicit Y ranges. X coming as well * feat: add new axis interface (#253)
Co-authored-by: “Andras <“andras.samu@supercharge.io”>
The goal is to have a new more easily expandable codebase, setup with CI and test so PRs could be merged quicker and safer.
If you would like to help and participate in the new version you are very welcomed you can find project related tasks here or under the Issues with a
v2
tagto submit your work please fork this repo and create a new branch from
new-version
branch then update with your work and create a PR for thenew-version
branch.If you work on a ticket please go to the project board and assign the ticket to yourself and move it to the in-progress column. If you are finished please assign the newly created PR to me and move your ticket to the ready-for-review column.
Join our Slack channel for day to day conversation and more insights:
slack invite link
New code proposal:
ChartViews
These chart views come with the bare minimum for a chart, so it can be easily built into custom user interfaces. We also build on them for the more complex chart widgets.
Data
x
andy
value.y
value must be numeric (possibly floating point number)x
can be numeric or stringy
values, 2)x
andy
numeric values 3) xstring
andy
numeric valuesBarchart:
Linechart:
Piechart:
Grid (not in beta 1)
barchart
andlinechart
Cardview
x
axis values interactivelysmall
,medium
,large
ChartData (beta 1 supports Chart init with [Double] only)
ChartData is an observable object so you can make state changes and it will be reflected now in the charts.
To initialise:
ChartData(_ data: [Double])
and to make a state change: