Coder Social home page Coder Social logo

adamnemecek / metal_chart Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wfreaks/metal_chart

1.0 3.0 0.0 922 KB

An iOS charting library using metal

License: MIT License

Objective-C 79.60% Objective-C++ 7.03% C++ 3.10% Metal 9.58% C 0.69%

metal_chart's Introduction

FMChart Documentation

FMChart is a charting framework that utilizes Metal API on A7+ iOS devices running iOS 8 or later.

Main Features

  • thin & light
  • flexible & customizable
  • fast
  • low CPU loads
  • explicit

Concepts & Models

In FMChart, a chart consists of :

  • Data space
  • Data series (in above space)
  • Projections (Data Space -> View)
  • Data Renderers (series+projection -> lines/points)
  • Attachment (Axis, label, plot area, etc)
  • Chart (container for above elements, view delegate)

You need to allocate them, configure their properties and relationships in order to fully manipulate a chart.
(You can use the utilities to omit conventional lines, though)

Sample Codes

See HealthKit sample. The view controller queries all systolic/diastolic blood pressures, weights and daily step counts from HealthKit, and then show them simultaneously.

Workflow

  1. Put a chart view (FMMetalView) on your storyboards / xibs.
  2. Create chart (and configurator if needed, configure view/delegate otherwise)
  3. Create dimensions, range filters, projection(range) updaters
  4. Create space by combining above dimensions
  5. Create data containers (series), insert data points if ready
  6. Create data renderers(FMRenderable) that hold the containers
  7. Create attachments (axis, labels, gridlines, plot area)
  8. Manage attributes(FMUniformXXXAttributes) and configurations
  9. Add renderers/attachments to chart (if not using configurator)
  10. (Re)Load data if necessary

Note that a FMChartConfigurator instance can perform almost all object allocations and initial settings.

Chart & Configurator

See

If you are not using FMChartConfigurator, you should follow :

  • Create FMSurfaceConfiguration instance FMEngine instance
  • Configure using [FMChartConfigurator configureMetalChart: view: preferredFps].
  • Set engine.device to view.device
  • Set chart as view.delegate
  • Create FMAnimator and FMGestureDispatcher, set relations

Creating Dimensions & Spaces

See

Adding Axes

See

Prefer using FMExclusiveAxis to FMSharedAxis when possible. You can share a range through dimension and updater even if you have multiple charts, space, axes and axis labels instances.

Adding Labels to Axes

See

FMAxisLabel requires Core Text and Core Graphics.
You can perform additional action to context before each text line rendering, and modify ranges of valid render cache (e.g. invalidate 3 labels from left side)

Adding Grid Lines

See

A grid line instance can be used without an axis (in this case you should manage configurations manually).

License

This software is released under the MIT License.

metal_chart's People

Contributors

adamnemecek avatar murkisk avatar wfreaks avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.