Packages

  • package root
    Definition Classes
    root
  • package scalax
    Definition Classes
    root
  • package chart

    This package contains a library for creating and working with charts.

    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.

    Definition Classes
    scalax
  • package event
    Definition Classes
    chart
  • package exporting
    Definition Classes
    chart
  • package module

    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.

    Definition Classes
    chart
  • Axis
  • CategoryChart
  • Chart
  • ChartCompanion
  • DocMacros
  • MultiplePieChart
  • PieChart
  • RingChart
  • SpiderWebChart
  • XYChart
  • api

abstract class Chart extends DisplayableChart with Publisher

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.

Source
Chart.scala
Linear Supertypes
Publisher, Reactor, DisplayableChart, DocMacros, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Chart
  2. Publisher
  3. Reactor
  4. DisplayableChart
  5. DocMacros
  6. AnyRef
  7. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Chart()
    Attributes
    protected

Type Members

  1. abstract type Plot <: org.jfree.chart.plot.Plot

    Returns the underlying plot type.

Abstract Value Members

  1. abstract def peer: module.Imports.JFreeChart

    Returns the underlying chart.

  2. abstract def plot: Plot

    Returns the underlying plot.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Chart to any2stringadd[Chart] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Chart, B)
    Implicit
    This member is added by an implicit conversion from Chart to ArrowAssoc[Chart] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def antiAlias: Boolean

    Returns true if this chart is drawn with anti-aliasing.

  7. def antiAlias_=(a: Boolean): Unit

    Sets whether or not this chart is drawn with anti-aliasing.

  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def backgroundPaint: module.Imports.Paint

    Returns the paint used for the chart background.

  10. def backgroundPaint_=(p: module.Imports.Paint): Unit

    Sets the paint used for the chart background.

  11. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def deafTo(ps: Publisher*): Unit
    Definition Classes
    Reactor
  13. def ensuring(cond: (Chart) ⇒ Boolean, msg: ⇒ Any): Chart
    Implicit
    This member is added by an implicit conversion from Chart to Ensuring[Chart] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: (Chart) ⇒ Boolean): Chart
    Implicit
    This member is added by an implicit conversion from Chart to Ensuring[Chart] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean, msg: ⇒ Any): Chart
    Implicit
    This member is added by an implicit conversion from Chart to Ensuring[Chart] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean): Chart
    Implicit
    This member is added by an implicit conversion from Chart to Ensuring[Chart] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Chart to StringFormat[Chart] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  21. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  22. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  23. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  24. def listenTo(ps: Publisher*): Unit
    Definition Classes
    Reactor
  25. val listeners: RefSet[Reaction] { val underlying: scala.collection.mutable.HashSet[scala.ref.Reference[scala.swing.Reactions.Reaction]] }
    Attributes
    protected
    Definition Classes
    Publisher
  26. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. final def notify(): Unit
    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  29. def publish(e: Event): Unit
    Definition Classes
    Publisher
  30. val reactions: Reactions
    Definition Classes
    Reactor
  31. def show(): Unit

    [use case] Shows the chart in a window.

    [use case]

    Shows the chart in a window.

    Definition Classes
    DisplayableChart
    Full Signature

    def show(title: String = "", resolution: (Int, Int) = Chart.Default.Resolution, scrollable: Boolean = false): Unit

  32. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  33. def title: String

    Returns the title of this chart.

  34. def title_=(title: String): Unit

    Sets the title of this chart.

  35. def toComponent(useBuffer: Boolean = Chart.Default.BufferUsed): Component

    Wraps this chart in a swing component.

    Wraps this chart in a swing component.

    useBuffer

    whether or not to use an off-screen buffer

    Definition Classes
    DisplayableChart
  36. def toComponent: Component

    Wraps this chart in a swing component.

    Wraps this chart in a swing component.

    Definition Classes
    DisplayableChart
  37. def toFrame(): Frame

    [use case] Wraps a frame around this chart.

    [use case]

    Wraps a frame around this chart.

    Definition Classes
    DisplayableChart
    Full Signature

    def toFrame(title: String = "", scrollable: Boolean = true): Frame

  38. def toString(): String
    Definition Classes
    AnyRef → Any
  39. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. def [B](y: B): (Chart, B)
    Implicit
    This member is added by an implicit conversion from Chart to ArrowAssoc[Chart] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
  43. object subtitles extends Buffer[Title]

    Contains this charts subtitles and legends.

Inherited from Publisher

Inherited from Reactor

Inherited from DisplayableChart

Inherited from DocMacros

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Chart to any2stringadd[Chart]

Inherited by implicit conversion StringFormat from Chart to StringFormat[Chart]

Inherited by implicit conversion Ensuring from Chart to Ensuring[Chart]

Inherited by implicit conversion ArrowAssoc from Chart to ArrowAssoc[Chart]

Ungrouped