Comments (6)
Yes. You will find everything you need in the examples, just have to combine the different components appropriately. The legends on top are not provided. You have to implement those views yourself.
from swiftcharts.
Thanks for your response, how can I get the vertical lines crossing through the circle points in the above chart and for the second chart candlestick will work I believe.
from swiftcharts.
You can use ChartPointsViewsLayer
where you can pass a view generator which creates an UIView
for each point... so basically you would have a layer that creates the line views, and another on top that creates the circle views (and of course layers for guidelines, axes, the dotted overlay etc.). You would use this for both charts. Here https://github.com/i-schuetz/SwiftCharts/blob/master/Examples/Examples/BarsExample.swift#L40 you see ChartPointsViewsLayer
used to generate bars. Or also here https://github.com/i-schuetz/SwiftCharts/blob/master/Examples/Examples/HelloWorld.swift#L43 there's a layer that generates a UILabel for each chart point.
Edit: To determine the top and bottom screen locations of the lines there are methods in ChartPointsLayer
, which is passed to the view generator - like modelLocToScreenLoc
which calculates screen location for model coordinates. In one of the candlestick examples - https://github.com/i-schuetz/SwiftCharts/blob/master/Examples/Examples/CandleStickInteractiveExample.swift#L100 you can see this in use.
You also can use a layer for the highlighted area between 80 and 140 in the first chart. The quickest approach would be to use also a ChartPointsViewsLayer
, pass a dummy chart point to it and generate a view that covers this area. To calculate the frame of this view you would also use modelLocToScreenLoc
.
from swiftcharts.
Thanks. :)
from swiftcharts.
How can I get the X-axis values in 12 Hr. format 12 AM, 12 PM, 12AM and as shown above how to customise for the week(Today and 21 Nov). I'm using ChartAxisValueDate for creating week and month but having trouble customising it.
from swiftcharts.
You can implement your own axis values, by subclassing ChartAxisValue. There you write custom logic to map between model data / internal value (scalar) and labels.
from swiftcharts.
Related Issues (20)
- Static library
- Temporarily hide lines in Line chart
- What's the correct way to set contentView background color and border? HOT 1
- Is this kind of y axis layout possible:
- Extending Views to create custom views isn't working due to file private and internal properties
- How to overlay a layer of labels?
- Axis disappear after coming back from background
- X Y points in horizontal bar chart keeps moving rights; when the y axis labels length (text) is more
- Swift 5
- Changing axis values
- X values not adding properly
- Axis Labels not showing up HOT 2
- ChartLabelSettings() ignoring supplied font color, always defaults to black HOT 1
- SPM Support?
- Problem building on new MacBook
- SPM not working properly due to missing TAG HOT 1
- x, y Axis didn't show in the Chart HOT 2
- ChartPointsBubbleLayer not draws properly HOT 1
- how to dynamic live update line chart
- How can i make xAxisLabel to get multiple data instead of one value for one xAxisLabel ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftcharts.