de.slothsoft.charts:gui-tests

A framework for creating charts.

License

License

Categories

Categories

Charts User Interface GUI
GroupId

GroupId

de.slothsoft.charts
ArtifactId

ArtifactId

gui-tests
Last Version

Last Version

0.2.1
Release Date

Release Date

Type

Type

jar
Description

Description

A framework for creating charts.

Download gui-tests

How to add to project

<!-- https://jarcasting.com/artifacts/de.slothsoft.charts/gui-tests/ -->
<dependency>
    <groupId>de.slothsoft.charts</groupId>
    <artifactId>gui-tests</artifactId>
    <version>0.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/de.slothsoft.charts/gui-tests/
implementation 'de.slothsoft.charts:gui-tests:0.2.1'
// https://jarcasting.com/artifacts/de.slothsoft.charts/gui-tests/
implementation ("de.slothsoft.charts:gui-tests:0.2.1")
'de.slothsoft.charts:gui-tests:jar:0.2.1'
<dependency org="de.slothsoft.charts" name="gui-tests" rev="0.2.1">
  <artifact name="gui-tests" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.slothsoft.charts', module='gui-tests', version='0.2.1')
)
libraryDependencies += "de.slothsoft.charts" % "gui-tests" % "0.2.1"
[de.slothsoft.charts/gui-tests "0.2.1"]

Dependencies

compile (2)

Group / Artifact Type Version
de.slothsoft.charts : charts jar 0.2.1
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Charts

Build Status Maven Central

A framework for creating charts. For my musings before even starting to code see the Preliminary Considerations.

Content:

Getting Started

Prerequisites

You need at least Java 1.8 or above to use this library. You can use Maven as a build tool, but Gradle or using plain JARs should work as well.

The .travis.yml shows which JDK this library is build and tested against.

Installing

This library is in Maven Central, so you can easily add it like this:

<dependency>
	<groupId>de.slothsoft.charts</groupId>
	<artifactId>charts</artifactId>
	<version>0.2.1</version>
</dependency>

<dependency>
	<groupId>de.slothsoft.charts</groupId>
	<artifactId>swt-charts</artifactId>
	<version>0.2.1</version>
</dependency>

<dependency>
	<groupId>de.slothsoft.charts</groupId>
	<artifactId>swing-charts</artifactId>
	<version>0.2.1</version>
</dependency>

For other build tools and the JAR take a look at Maven Central or the MVN Repository.

Using the Framework

Examples for how to use this framework are located here.

You usually start by creating the chart you wish to display.3

BarChart:

BarChart chart = new BarChart();
chart.addBars(13, 5, 10, 15);

LineChart:

LineChart chart = new LineChart();
chart.addLine(new DataPointLine(-4, -2, -1, -0.5, 0));
chart.addLine(new FunctionLine(x -> Math.cos(x)).color(0xFF00FFFF));

PieChart:

PieChart chart = new PieChart();
chart.addSlices(1, 3, 5, 15);

And then you need to set these charts as the model for your GUI framework.

SWT:

ChartControl chartControl = new ChartControl(shell, SWT.BORDER);
chartControl.setModel(chart);

Swing:

ChartControl chartControl = new ChartControl(chart);

There are more extensive examples here, for instance:

Versions

Version Changes
Future
0.2.1 Hotfix
0.2.0 Swing GUI & bar chart
0.1.0 first draft of the API

Features

If something is missing, request it via a new issue.

To see examples of the charts in action, check the wiki page. This page contains an image for each chart and GUI framework.

For the features of the GUI controls see this wiki page.

Chart

All charts have these features:

  • hook RefreshListeners that get notified over changes
  • configure Border (JavaDoc)
    • change general display information (spaces on all four sides)
  • configure Title (JavaDoc)
    • change general display information (displayed text, color, font, size, position, text alignment)
  • change general display information (background color)

BarChart

Bar charts have these features:

  • all the features of Chart
  • manage the bars of the chart (add, remove)
    • change general display information (value, color)
  • change general display information (default bar color)

LineChart

Line charts have these features:

  • all the features of Chart
  • manage lines (add, remove)
    • line implementation for functions and for concrete data points
    • change general display information (color)
  • configure XAxis (JavaDoc) and YAxis (JavaDoc)
    • change general display information (tick size and step length, arrow size, position)

PieChart

Pie charts have these features:

  • all the features of Chart
  • manage the slices of the chart (add, remove)
    • change general display information (percentage value, color)
  • change general display information (start angle, pie color, pie border)

License

This project is licensed under the MIT License - see the MIT license for details.

Versions

Version
0.2.1
0.2.0