Giter VIP home page Giter VIP logo

chartscript's Introduction

CircleCI branch GitHub tag (latest SemVer) Maven Central

ChartScript

ChartScript is an open source software library for script based chart generation. Each chart can be fully customized by the chartscript DSL.

PieChart

A pie chart definition can be started by the function piechart.

piechart{
   value("Java", 17)
   value("C/C++", 10)
   value("Python", 7)
   value("C#", 5)
   value("Javascript", 3)
}

The piechart function accepts a style callback in order to modify style settings.

piechart({backgroundPaint("blue")}){
   value("Java", 17)
   value("C/C++", 10)
   value("Python", 7)
   value("C#", 5)
   value("Javascript", 3)
}

The style callback accepts the following properties:

signature Description
title(title:String) Sets the title of the chart
backgroundPaint(paint:String) Sets the background paint via a css compliant color string
labelBackgroundPaint(paint:String) Sets the background paint of the labels via a css compliant color string
labelOutlinePaint(paint:String) Sets the paint of the label outline via a css compliant color string
labelShadowPaint(paint:String) Sets the paint of the label shadow via a css compliant color string
shadowPaint(paint:String) Sets the paint of the chart shadow via a css compliant color string
isOutlineVisible(visible:Boolean) Indicates if the chart outline is visible
borderPaint(paint:String) Sets the paint of the chart border via a css compliant color string
labelPaint(paint:String) Sets the paint of the labels via a css compliant color string
labelLinkStroke(width:Number) Sets the stroke of the label link
labelOutlineStroke(width:Number) Sets the stroke of the label outline
outlineStroke(width:Number) Sets the stroke of the chart outline
borderStroke(width:Number) Sets the stroke of the chart border
antiAlias(b:Boolean) Indicates if anti alias is enabled
isBorderVisible(b:Boolean) Indicates if the border is visible
simpleLabels(b:Boolean) Indicates if labels are in the segments
labelFont(font:String, size:Number) Sets the font for the labels
legendPosition(position:String) Sets the position of the legend. Possible values are "bottom", "left", "right" and "top"
legendShape(shape:String) Sets the shape of the legend items. Possible values are "box" and "circle"
legendFont(font:String, size: Number) Sets the font of the legend items.
labelFormat(format:String) Sets the format of the labels. Possible string placeholders are {0} (value), {1} (amount) and {2} (percent)

Each value of a piechart accepts a value style callback in order to modify value specific style settings.

piechart {
   value("Java", 17) {background("blue")}
   value("C/C++", 10)
   value("Python", 7)
   value("C#", 5)
   value("Javascript", 3)
}

The value style callback accepts the following properties:

signature Description
background(paint:String) Sets the background of the value slice via a css compliant color string
explodePercent(percent:Number) Sets the amount of space between the value slice and all other value slices

BarChart

A bar chart definition can be started by the function barchart.

barchart("labelX", "labelY"){
   value(10, 15, 20)
   value(5, 17, 12)
   value(14, 19, 27)
}

The barchart function accepts a style callback in order to modify style settings.

barchart("labelX", "labelY", {vertical(false)}){
   value(10, 15, 20)
   value(5, 17, 12)
   value(14, 19, 27)
}

The style callback accepts the following properties:

signature Description
title(title:String) Sets the title of the chart
backgroundPaint(paint:String) Sets the background paint via a css compliant color string
isOutlineVisible(visible:Boolean) Indicates if the chart outline is visible
borderPaint(paint:String) Sets the paint of the chart border via a css compliant color string
outlineStroke(width:Number) Sets the stroke of the chart outline
borderStroke(width:Number) Sets the stroke of the chart border
antiAlias(b:Boolean) Indicates if anti alias is enabled
isBorderVisible(b:Boolean) Indicates if the border is visible
legendPosition(position:String) Sets the position of the legend. Possible values are "bottom", "left", "right" and "top"
legendFont(font:String, size: Number) Sets the font of the legend items.
vertical(b:Boolean) Indicates if the plot orientation is vertical or horizontal
seriesPaint(series:Int, paint:String) Sets the paint of a series via a css compliant color string

Development

Release

Releases are triggered locally. Just a tag will be pushed and CI pipelines take care of the rest.

Major

Run ./gradlew final -x sendReleaseEmail -Prelease.scope=major locally.

Minor

Run ./gradlew final -x sendReleaseEmail -Prelease.scope=minor locally.

Patch

Run ./gradlew final -x sendReleaseEmail -Prelease.scope=patch locally.

chartscript's People

Contributors

aemaem avatar c7nw3r avatar fridayy avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  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.