Git Product home page Git Product logo

Comments (6)

ivnsch avatar ivnsch commented on July 22, 2024

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.

bmacin avatar bmacin commented on July 22, 2024

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.

ivnsch avatar ivnsch commented on July 22, 2024

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.

bmacin avatar bmacin commented on July 22, 2024

Thanks. :)

from swiftcharts.

bmacin avatar bmacin commented on July 22, 2024

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.

ivnsch avatar ivnsch commented on July 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.