Code Monkey home page Code Monkey logo

charts's Introduction

charts's People

Contributors

eikes avatar netznarkose avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

charts's Issues

Make colors configurable via the options

Instead of providing the item colors as a key in the data hash, we should pass in the data as a simple Array and pass in the colors as an option.

We should fail if the number of colors does not match the number of data items unless no colors are provided.

If no colors are provided, we should provide a set of default colors, maybe move BarGraph#colors to Graph.

For example:

CircleCountGraph.new([32,21,12], colors: [:red, :blue, :green])

The SymbolCountGraph gets Symbols passed from Options

SymbolCountGraph.new([12,4,15], colors: ['*', '@', '$']

Manikin BitmapGraph Render Bug

css-class definition in style causes ArgumentError in BitmapGraph

  def body(x, y, color)
    center_x = center_(x)
    top    = y + item_height / 2
    bottom = y + item_height
    style  = {
      stroke:         color,
      stroke_width:   item_width / 4,
      stroke_linecap: 'round',
      class:          'body'     <-----------------------------------------
    }

    renderer.line center_x, top, center_x, bottom, style
  end

Background color

Allow the configuration of a background color. Default is white.

Add outer margin

We need to be able to set a outer margin, so that the items do not go to the edge of the image. The default should be 20px.

Add inner margin

We need to be able to set a inner margin between the items, so that they do not touch each other. The default should be 2px.

Add legend

We need to be able to provide an option which allows us to specify a label for each data item. The names should be rendered in a legend box below the dots

We should fail if the number of labels is smaller then the number of data items unless no labels are provided.

For example:

CircleCountGraph.new([32,21,12], labels: ['Cars', 'Buses', 'Bikes'])

TODO vs. DONE

  • implement lables in SvgRenderer
  • implement labels in MagickRenderer

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.