Giter Site home page Giter Site logo

chartd-swift's Introduction

chartd-swift

A small library to easily construct URLs for ChartD

This service lets you construct simple graphs as images to easily send them around in places where it might not be convenient to upload a file to.

A good example for where this can be helpful is when building automations into Slack (or any messaging service). You want to show a graph or a chart, but don't feel like generating the chart image yourself, storing it somewhere that Slack can access it, and then including the URL.

Just use a chartd URL to get that graphical information right into your service!

Usage

Instantiate a builder, and add the properties you would like to help define your chart. Please note, the following poperties are mandatory:

  • height
  • width
  • at least 1 dataset (but no more than 5)

After you've configured the builder, simply call .url(), optionally you can specify if you want a PNG or SVG version of your chart in this call as well.

Here's a complete example:

let url = try ChartDURLBuilder()
    .height(200)
    .width(400)
    .datasets([
        .init(data: "98851"), // pass in a pre-encoded string for your data
        .init(data: [0.1, 0.0, 0.8, 0.9].base62encode(minimum: 0.0, maximum: 1.0)) // or, encode the data on the fly.
     ])
     .url()

chartd-swift's People

Contributors

brianmichel avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.