Package

scalax

chart

Permalink

package chart

This package contains a library for creating and working with charts. It wraps JFreeChart, much like scala.swing does with the original javax.swing package.

Getting Started

There is an all you can eat import providing all the high-level functionality of this library:

import scalax.chart.api._

val data = for (i <- 1 to 5) yield (i,i)
val chart = XYLineChart(data)
chart.saveAsPNG("/tmp/chart.png")

All of the functionality of the api object is also contained by module.Charting, which you can either import or use as a mixin:

object MyChartApp extends App with scalax.chart.module.Charting {
  val data = for (i <- 1 to 5) yield (i,i)
  val chart = XYLineChart(data)
  chart.saveAsPNG("/tmp/chart.png")
}

The module package provides a la carte imports, which you can import or mix in for only parts of the API. To find out more about the modules in detail, have a look at the documentation of the module.Charting module. From there on you can discover the modules one by one.

Source
package.scala
Linear Supertypes
AnyRef, Any
Content Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. chart
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract class Axis extends AnyRef

    Permalink

    Represents a line of reference.

  2. abstract class CategoryChart extends Chart with Orientable with Labels[chart.module.CategoryToolTipGenerators.CategoryLabelGenerator] with Tooltips[chart.module.CategoryToolTipGenerators.CategoryToolTipGenerator]

    Permalink

    Represents categorized numeric data.

    Represents categorized numeric data. These charts have a domain axis that consists of the categories and a numeric range axis.

  3. abstract class Chart extends DisplayableChart with Publisher

    Permalink

    Generic graphical representation of data.

    Generic graphical representation of data.

    Swing Integration

    This abstraction provides direct integration with the Scala Swing UI framework.

    val component = chart.toComponent
    val frame = chart.toFrame()

    There is also a way to immediately display the chart in a new GUI window. This is intended for interactive usage, e.g. when working with the Scala REPL. The simplest form is:

    chart.show()

    Listen to UI mouse events:

    import scalax.chart.event._
    
    val chart = ???
    val ui = chart.toComponent // or chart.toFrame()
    val reactor = ???
    
    reactor.listenTo(ui)
    reactor.reactions += {
      case event: ChartMouseEvent =>
        // do something with event
    }

    Exporting Charts

    See module.Exporting for more information.

  4. abstract class ChartCompanion[C <: Chart] extends DocMacros

    Permalink

    A template class for companion objects of Chart classes.

  5. trait DocMacros extends Any

    Permalink

    Mixin solely for the purpose of providing common documentation macros.

    Mixin solely for the purpose of providing common documentation macros.

    Concrete

    The following list contains macros that are usually overridden by concrete representations:

    • $chart = chart
    • $Chart = Chart

    Basic

    The following list contains basic macros that are usually not overridden:

    • $data = the data the chart will visualize
    • $legend = whether or not the chart will contain a legend
    • $orientation = the orientation of the chart
    • $peer = the underlying chart
    • $resolution = dimension / geometry / width x height
    • $theme = the theme to apply to the chart
    • $title = the title of the chart
  6. abstract class MultiplePieChart extends Chart with Labels[chart.module.CategoryDatasetConversions.PieLabelGenerator] with Tooltips[chart.module.CategoryDatasetConversions.PieToolTipGenerator]

    Permalink

    Represents categorized numeric data with multiple pies.

  7. abstract class PieChart extends Chart with PieChartLike

    Permalink

    Represents categorized numeric data with a pie.

  8. abstract class RingChart extends Chart with PieChartLike

    Permalink

    Represents categorized numeric data with a ring.

  9. abstract class SpiderWebChart extends Chart

    Permalink

    Represents categorized numeric data with a "Spider Web" radar.

  10. abstract class XYChart extends Chart with Orientable with Labels[chart.module.XYToolTipGenerators.XYLabelGenerator] with Tooltips[chart.module.XYToolTipGenerators.XYToolTipGenerator]

    Permalink

    Represents numeric data.

Value Members

  1. object CategoryChart extends ChartCompanion[CategoryChart]

    Permalink

    Low-level factory for category charts.

  2. object Chart extends ChartCompanion[Chart]

    Permalink

    Provides a very basic factory to turn any JFreeChart into a Chart and contains default settings.

  3. object MultiplePieChart extends ChartCompanion[MultiplePieChart]

    Permalink

    Factory for multiple pie charts.

  4. object PieChart extends ChartCompanion[PieChart]

    Permalink

    Factory for pie charts.

  5. object RingChart extends ChartCompanion[RingChart]

    Permalink

    Factory for ring charts.

  6. object SpiderWebChart extends ChartCompanion[SpiderWebChart]

    Permalink

    Factory for SpiderWeb charts.

  7. object XYChart extends ChartCompanion[XYChart]

    Permalink

    Low-level factory for XY charts.

  8. object api extends Charting

    Permalink

    All-you-can-eat import providing all the high-level functionality of this library.

    All-you-can-eat import providing all the high-level functionality of this library.

    See also

    module for a la carte imports and documentation thereof

  9. package event

    Permalink
  10. package exporting

    Permalink
  11. package module

    Permalink

    This package provides a la carte imports.

    This package provides a la carte imports. It is organized into modules following the Scala's Selfless Trait Pattern. Some of these modules depend on each other. In this case, there is often a short documentation in the higher-level module and links to the lower-level modules. Have a look for yourself and start at the highest-level all you can eat module Charting.

Inherited from AnyRef

Inherited from Any

Ungrouped