package module
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.
- Source
- package.scala
- Alphabetic
- By Inheritance
- module
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
BoxAndWhiskerChartFactories
extends BoxAndWhiskerDatasetConversions with DocMacros
Contains factories to create box charts.
-
trait
BoxAndWhiskerDatasetConversions
extends Converting with RichChartingCollections
Provides converters for datasets used for box charts.
-
trait
CategoryChartFactories
extends DatasetConversions with RichPlot with DocMacros
CategoryChartFactories contains all high-level factories to conveniently create charts based on category datasets.
-
trait
CategoryDatasetConversions
extends Converting with RichChartingCollections
Provides converters for datasets used for category charts and multiple pie charts.
-
trait
CategoryLabelGenerators
extends Imports
CategoryLabelGenerators contains factories for creating label generators for category charts.
CategoryLabelGenerators contains factories for creating label generators for category charts.
chart.labelGenerator = CategoryLabelGenerator(value => value.toString)
The following list contains various ways on how to create and set label generators for category charts:
val data = for (i <- 1 to 5) yield (i,i) val chart = BarChart(data) chart.labelGenerator = (dataset: CategoryDataset, series: Comparable[_], category: Comparable[_]) => dataset.getValue(series,category).toString chart.labelGenerator = CategoryLabelGenerator { (dataset, series, category) => dataset.getValue(series,category).toString } chart.labelGenerator = CategoryLabelGenerator(_.getValue(_,_).toString) chart.labelGenerator = CategoryLabelGenerator(value => value.toString) chart.labelGenerator = CategoryLabelGenerator(_.toString) chart.labelGenerator = CategoryLabelGenerator.Default
-
trait
CategoryToolTipGenerators
extends Imports
CategoryToolTipGenerators contains factories for creating tool tip generators for category charts.
CategoryToolTipGenerators contains factories for creating tool tip generators for category charts.
chart.tooltipGenerator = CategoryToolTipGenerator(value => value.toString)
The following list contains various ways on how to create and set tool tip generators for category charts:
val data = for (i <- 1 to 5) yield (i,i) val chart = BarChart(data) chart.tooltipGenerator = (dataset: CategoryDataset, series: Comparable[_], category: Comparable[_]) => dataset.getValue(series,category).toString chart.tooltipGenerator = CategoryToolTipGenerator { (dataset, series, category) => dataset.getValue(series,category).toString } chart.tooltipGenerator = CategoryToolTipGenerator(_.getValue(_,_).toString) chart.tooltipGenerator = CategoryToolTipGenerator(value => value.toString) chart.tooltipGenerator = CategoryToolTipGenerator(_.toString) chart.tooltipGenerator = CategoryToolTipGenerator.Default
-
trait
ChartFactories
extends BoxAndWhiskerChartFactories with CategoryChartFactories with PieChartFactories with SpiderWebChartFactory with XYChartFactories with DatasetConversions with DocMacros
ChartFactories contains all high-level factories to conveniently create charts.
ChartFactories contains all high-level factories to conveniently create charts.
val data = for (i <- 1 to 5) yield (i,i) val chart = XYLineChart(data)
Creating Charts
The only argument needed to create a chart is a dataset:
val data = for (i <- 1 to 5) yield (i,i) val dataset = data.toXYSeriesCollection("some data") val chart = XYLineChart(dataset)
Creating Charts with Themes
The default theme used is the JFreeChart theme. To apply a different theme to the charts created by the factories, simply define an implicit chart theme in scope, e.g. the darkness theme from JFreeChart:
implicit val theme = org.jfree.chart.StandardChartTheme.createDarknessTheme
-
trait
Charting
extends ChartFactories with DatasetConversions with Exporting with RichPlot with LabelGenerators with ToolTipGenerators
Contains all enrichments.
Contains all enrichments.
Creating Charts
ChartFactories contains all high-level factories to conveniently create charts.
val data = for (i <- 1 to 5) yield (i,i) val chart = XYLineChart(data)
Exporting Charts
Exporting contains enrichments to conveniently export charts to disk.
chart.saveAsPNG("/tmp/chart.png")
Labels
LabelGenerators contains means to conveniently create label generators for all supported chart types.
val chart = PieChart(data) chart.labelGenerator = PieLabelGenerator(value => value.toString)
Rich Plots
RichPlot contains enriched plot types to conveniently work with the plot domain, range and marking.
chart.plot.domain.axis.label.text = "my label" chart.plot.range.markers += ((1,1))
Tool Tips
ToolTipGenerators contains means to conveniently create tool tip generators for all supported chart types.
val chart = PieChart(data) chart.tooltipGenerator = PieToolTipGenerator(value => value.toString)
-
trait
Converting
extends AnyRef
Provides the Converter type class and a generic ConverterCompanion for it.
-
trait
DatasetConversions
extends BoxAndWhiskerDatasetConversions with CategoryDatasetConversions with PieDatasetConversions with TableXYDatasetConversions with XYDatasetConversions
Provides all dataset converters.
-
trait
Exporting
extends AnyRef
Exporting contains enrichments to conveniently export charts to disk.
Exporting contains enrichments to conveniently export charts to disk.
chart.saveAsPNG("/tmp/chart.png")
Supported Formats
Charts may be exported into the following formats:
- JPEG
- PNG
- PDF, needs the optional dependency
"com.itextpdf" % "itextpdf"
on your class path - SVG, needs the optional dependency
"org.jfree" % "jfreesvg"
on your class path
Export Stages
There are different stages in which charts may be exported: encoding, writing and the actual saving of the file, which is demonstrated by the following code snippet:
val bytes = chart.encodeAsPNG() chart.writeAsPNG(System.out) chart.saveAsPNG("/tmp/chart.png")
-
trait
Imports
extends AnyRef
Contains imports from other libraries, most notably JFreeChart.
-
trait
LabelGenerators
extends CategoryLabelGenerators with PieLabelGenerators with XYLabelGenerators
LabelGenerators contains means to conveniently create label generators for all supported chart types.
LabelGenerators contains means to conveniently create label generators for all supported chart types.
val chart = PieChart(data) chart.labelGenerator = PieLabelGenerator(value => value.toString)
Labels for Category Charts
CategoryLabelGenerators contains factories for creating label generators for category charts.
chart.labelGenerator = CategoryLabelGenerator(value => value.toString)
Labels for Pie-like Charts
PieLabelGenerators contains factories for creating label generators for pie charts.
chart.labelGenerator = PieLabelGenerator(value => value.toString)
Labels for XY Charts
XYLabelGenerators contains factories for creating label generators for xy charts.
chart.labelGenerator = XYLabelGenerator(value => value.toString)
-
trait
MarkerConversions
extends Imports
MarkerConversions contains type class based conversions from certain types to
Marker
instances.MarkerConversions contains type class based conversions from certain types to
Marker
instances.chart.plot.domain.markers += 1
All numeric types and numeric ranges are supported to create simple value markers:
chart.plot.range.markers += 3 chart.plot.range.markers += 3L chart.plot.range.markers += 3.0 chart.plot.range.markers += ((1.0,2.0))
There is also an additional conversion type class for the domain of CategoryCharts you can use for
CategoryMarker
s, which support arbitraryComparable
s likeString
:chart.plot.domain.markers += "category"
The legacy JFreeChart classes can still be used directly:
chart.plot.range.markers += new ValueMarker(3.0) chart.plot.range.markers += new IntervalMarker(1.0, 2.0) chart.plot.domain.markers += new CategoryMarker("category")
-
trait
PieChartFactories
extends AnyRef
Contains factories to create pie charts and other pie-like chart.
-
trait
PieDatasetConversions
extends Converting with RichChartingCollections
Provides converters for datasets used for pie charts and ring charts.
-
trait
PieLabelGenerators
extends Imports
PieLabelGenerators contains factories for creating label generators for pie charts.
PieLabelGenerators contains factories for creating label generators for pie charts.
chart.labelGenerator = PieLabelGenerator(value => value.toString)
The following list contains various ways on how to create and set label generators for pie charts:
val data = for (i <- 1 to 5) yield (i,i) val chart = PieChart(data) chart.labelGenerator = (dataset: PieDataset, key: Comparable[_]) => dataset.getValue(key).toString chart.labelGenerator = PieLabelGenerator { (dataset, key) => dataset.getValue(key).toString } chart.labelGenerator = PieLabelGenerator(_.getValue(_).toString) chart.labelGenerator = PieLabelGenerator(value => value.toString) chart.labelGenerator = PieLabelGenerator(_.toString) chart.labelGenerator = PieLabelGenerator.Default
-
trait
PieToolTipGenerators
extends Imports
PieToolTipGenerators contains factories for creating tool tip generators for pie charts.
PieToolTipGenerators contains factories for creating tool tip generators for pie charts.
chart.tooltipGenerator = PieToolTipGenerator(value => value.toString)
The following list contains various ways on how to create and set tool tip generators for pie charts:
val data = for (i <- 1 to 5) yield (i,i) val chart = PieChart(data) chart.tooltipGenerator = (dataset: PieDataset, key: Comparable[_]) => dataset.getValue(key).toString chart.tooltipGenerator = PieToolTipGenerator { (dataset, key) => dataset.getValue(key).toString } chart.tooltipGenerator = PieToolTipGenerator(_.getValue(_).toString) chart.tooltipGenerator = PieToolTipGenerator(value => value.toString) chart.tooltipGenerator = PieToolTipGenerator(_.toString) chart.tooltipGenerator = PieToolTipGenerator.Default
-
trait
RichChartingCollections
extends Imports
Contains enrichments for collections for conversions to datasets.
Contains enrichments for collections for conversions to datasets. To see which conversions are provided have a look at the classes defined below.
-
trait
RichPlot
extends MarkerConversions
RichPlot contains enriched plot types to conveniently work with the plot domain, range and marking.
RichPlot contains enriched plot types to conveniently work with the plot domain, range and marking.
chart.plot.domain.axis.label.text = "my label" chart.plot.range.markers += ((1,1))
Marking
There are enrichments concerning the handling of markers in plots:
chart.plot.domain.markers += 1 chart.plot.range.markers += ((1,1)) for (marker <- chart.plot.range.markers) { // do something with marker }
Marker Conversions
MarkerConversions contains type class based conversions from certain types to
Marker
instances.chart.plot.domain.markers += 1
-
trait
SpiderWebChartFactory
extends AnyRef
Contains factories to create spider web charts aka radar charts.
-
trait
TableXYDatasetConversions
extends Converting with RichChartingCollections
Provides converters for
TableXYDatasets
. -
trait
ToolTipGenerators
extends CategoryToolTipGenerators with PieToolTipGenerators with XYToolTipGenerators
ToolTipGenerators contains means to conveniently create tool tip generators for all supported chart types.
ToolTipGenerators contains means to conveniently create tool tip generators for all supported chart types.
val chart = PieChart(data) chart.tooltipGenerator = PieToolTipGenerator(value => value.toString)
Tool Tips for Category Charts
CategoryToolTipGenerators contains factories for creating tool tip generators for category charts.
chart.tooltipGenerator = CategoryToolTipGenerator(value => value.toString)
Tool Tips for Pie-like Charts
PieToolTipGenerators contains factories for creating tool tip generators for pie charts.
chart.tooltipGenerator = PieToolTipGenerator(value => value.toString)
Tool Tips for XY Charts
XYToolTipGenerators contains factories for creating tool tip generators for xy charts.
chart.tooltipGenerator = XYToolTipGenerator(value => value.toString)
-
trait
XYChartFactories
extends DatasetConversions with DocMacros
XYChartFactories contains all high-level factories to conveniently create xy charts.
-
trait
XYDatasetConversions
extends Converting with RichChartingCollections
Provides converters for datasets used for xy charts.
-
trait
XYLabelGenerators
extends Imports
XYLabelGenerators contains factories for creating label generators for xy charts.
XYLabelGenerators contains factories for creating label generators for xy charts.
chart.labelGenerator = XYLabelGenerator(value => value.toString)
The following list contains various ways on how to create and set label generators for xy charts:
val data = for (i <- 1 to 5) yield (i,i) val chart = XYLineChart(data) chart.labelGenerator = (dataset: XYDataset, series: Comparable[_], item: Int) => val idx = dataset.indexOf(series) dataset.getY(idx, item).toString } chart.labelGenerator = XYLabelGenerator { (dataset, series, item) => val idx = dataset.indexOf(series) dataset.getY(idx,item).toString } chart.labelGenerator = XYLabelGenerator(value => value.toString) chart.labelGenerator = XYLabelGenerator(_.toString) chart.labelGenerator = XYLabelGenerator((x,y) => s"""($x,$y)""") chart.labelGenerator = XYLabelGenerator.Default
-
trait
XYToolTipGenerators
extends Imports
XYToolTipGenerators contains factories for creating tool tip generators for xy charts.
XYToolTipGenerators contains factories for creating tool tip generators for xy charts.
chart.tooltipGenerator = XYToolTipGenerator(value => value.toString)
The following list contains various ways on how to create and set tool tip generators for xy charts:
val data = for (i <- 1 to 5) yield (i,i) val chart = XYLineChart(data) chart.tooltipGenerator = (dataset: XYDataset, series: Comparable[_], item: Int) => val idx = dataset.indexOf(series) dataset.getY(idx, item).toString } chart.tooltipGenerator = XYToolTipGenerator { (dataset, series, item) => val idx = dataset.indexOf(series) dataset.getY(idx,item).toString } chart.tooltipGenerator = XYToolTipGenerator(value => value.toString) chart.tooltipGenerator = XYToolTipGenerator(_.toString) chart.tooltipGenerator = XYToolTipGenerator((x,y) => s"""($x,$y)""") chart.tooltipGenerator = XYToolTipGenerator.Default
Value Members
-
object
BoxAndWhiskerChartFactories
extends BoxAndWhiskerChartFactories
Contains factories to create box charts.
-
object
BoxAndWhiskerDatasetConversions
extends BoxAndWhiskerDatasetConversions
Provides converters for datasets used for box charts.
-
object
CategoryChartFactories
extends CategoryChartFactories
CategoryChartFactories contains all high-level factories to conveniently create charts based on category datasets.
-
object
CategoryDatasetConversions
extends CategoryDatasetConversions
Provides converters for datasets used for category charts and multiple pie charts.
-
object
CategoryLabelGenerators
extends CategoryLabelGenerators
CategoryLabelGenerators contains factories for creating label generators for category charts.
CategoryLabelGenerators contains factories for creating label generators for category charts.
chart.labelGenerator = CategoryLabelGenerator(value => value.toString)
The following list contains various ways on how to create and set label generators for category charts:
val data = for (i <- 1 to 5) yield (i,i) val chart = BarChart(data) chart.labelGenerator = (dataset: CategoryDataset, series: Comparable[_], category: Comparable[_]) => dataset.getValue(series,category).toString chart.labelGenerator = CategoryLabelGenerator { (dataset, series, category) => dataset.getValue(series,category).toString } chart.labelGenerator = CategoryLabelGenerator(_.getValue(_,_).toString) chart.labelGenerator = CategoryLabelGenerator(value => value.toString) chart.labelGenerator = CategoryLabelGenerator(_.toString) chart.labelGenerator = CategoryLabelGenerator.Default
-
object
CategoryToolTipGenerators
extends CategoryToolTipGenerators
CategoryToolTipGenerators contains factories for creating tool tip generators for category charts.
CategoryToolTipGenerators contains factories for creating tool tip generators for category charts.
chart.tooltipGenerator = CategoryToolTipGenerator(value => value.toString)
The following list contains various ways on how to create and set tool tip generators for category charts:
val data = for (i <- 1 to 5) yield (i,i) val chart = BarChart(data) chart.tooltipGenerator = (dataset: CategoryDataset, series: Comparable[_], category: Comparable[_]) => dataset.getValue(series,category).toString chart.tooltipGenerator = CategoryToolTipGenerator { (dataset, series, category) => dataset.getValue(series,category).toString } chart.tooltipGenerator = CategoryToolTipGenerator(_.getValue(_,_).toString) chart.tooltipGenerator = CategoryToolTipGenerator(value => value.toString) chart.tooltipGenerator = CategoryToolTipGenerator(_.toString) chart.tooltipGenerator = CategoryToolTipGenerator.Default
-
object
ChartFactories
extends ChartFactories
ChartFactories contains all high-level factories to conveniently create charts.
ChartFactories contains all high-level factories to conveniently create charts.
val data = for (i <- 1 to 5) yield (i,i) val chart = XYLineChart(data)
Creating Charts
The only argument needed to create a chart is a dataset:
val data = for (i <- 1 to 5) yield (i,i) val dataset = data.toXYSeriesCollection("some data") val chart = XYLineChart(dataset)
Creating Charts with Themes
The default theme used is the JFreeChart theme. To apply a different theme to the charts created by the factories, simply define an implicit chart theme in scope, e.g. the darkness theme from JFreeChart:
implicit val theme = org.jfree.chart.StandardChartTheme.createDarknessTheme
-
object
Charting
extends Charting
Contains all enrichments.
Contains all enrichments.
Creating Charts
ChartFactories contains all high-level factories to conveniently create charts.
val data = for (i <- 1 to 5) yield (i,i) val chart = XYLineChart(data)
Exporting Charts
Exporting contains enrichments to conveniently export charts to disk.
chart.saveAsPNG("/tmp/chart.png")
Labels
LabelGenerators contains means to conveniently create label generators for all supported chart types.
val chart = PieChart(data) chart.labelGenerator = PieLabelGenerator(value => value.toString)
Rich Plots
RichPlot contains enriched plot types to conveniently work with the plot domain, range and marking.
chart.plot.domain.axis.label.text = "my label" chart.plot.range.markers += ((1,1))
Tool Tips
ToolTipGenerators contains means to conveniently create tool tip generators for all supported chart types.
val chart = PieChart(data) chart.tooltipGenerator = PieToolTipGenerator(value => value.toString)
-
object
Converting
extends Converting
Provides the Converter type class and a generic ConverterCompanion for it.
-
object
DatasetConversions
extends DatasetConversions
Provides all dataset converters.
-
object
Exporting
extends Exporting
Exporting contains enrichments to conveniently export charts to disk.
Exporting contains enrichments to conveniently export charts to disk.
chart.saveAsPNG("/tmp/chart.png")
Supported Formats
Charts may be exported into the following formats:
- JPEG
- PNG
- PDF, needs the optional dependency
"com.itextpdf" % "itextpdf"
on your class path - SVG, needs the optional dependency
"org.jfree" % "jfreesvg"
on your class path
Export Stages
There are different stages in which charts may be exported: encoding, writing and the actual saving of the file, which is demonstrated by the following code snippet:
val bytes = chart.encodeAsPNG() chart.writeAsPNG(System.out) chart.saveAsPNG("/tmp/chart.png")
-
object
Imports
extends Imports
Contains imports from other libraries, most notably JFreeChart.
-
object
LabelGenerators
extends LabelGenerators
LabelGenerators contains means to conveniently create label generators for all supported chart types.
LabelGenerators contains means to conveniently create label generators for all supported chart types.
val chart = PieChart(data) chart.labelGenerator = PieLabelGenerator(value => value.toString)
Labels for Category Charts
CategoryLabelGenerators contains factories for creating label generators for category charts.
chart.labelGenerator = CategoryLabelGenerator(value => value.toString)
Labels for Pie-like Charts
PieLabelGenerators contains factories for creating label generators for pie charts.
chart.labelGenerator = PieLabelGenerator(value => value.toString)
Labels for XY Charts
XYLabelGenerators contains factories for creating label generators for xy charts.
chart.labelGenerator = XYLabelGenerator(value => value.toString)
-
object
MarkerConversions
extends MarkerConversions
MarkerConversions contains type class based conversions from certain types to
Marker
instances.MarkerConversions contains type class based conversions from certain types to
Marker
instances.chart.plot.domain.markers += 1
All numeric types and numeric ranges are supported to create simple value markers:
chart.plot.range.markers += 3 chart.plot.range.markers += 3L chart.plot.range.markers += 3.0 chart.plot.range.markers += ((1.0,2.0))
There is also an additional conversion type class for the domain of CategoryCharts you can use for
CategoryMarker
s, which support arbitraryComparable
s likeString
:chart.plot.domain.markers += "category"
The legacy JFreeChart classes can still be used directly:
chart.plot.range.markers += new ValueMarker(3.0) chart.plot.range.markers += new IntervalMarker(1.0, 2.0) chart.plot.domain.markers += new CategoryMarker("category")
-
object
PieChartFactories
extends PieChartFactories
Contains factories to create pie charts and other pie-like chart.
-
object
PieDatasetConversions
extends PieDatasetConversions
Provides converters for datasets used for pie charts and ring charts.
-
object
PieLabelGenerators
extends PieLabelGenerators
PieLabelGenerators contains factories for creating label generators for pie charts.
PieLabelGenerators contains factories for creating label generators for pie charts.
chart.labelGenerator = PieLabelGenerator(value => value.toString)
The following list contains various ways on how to create and set label generators for pie charts:
val data = for (i <- 1 to 5) yield (i,i) val chart = PieChart(data) chart.labelGenerator = (dataset: PieDataset, key: Comparable[_]) => dataset.getValue(key).toString chart.labelGenerator = PieLabelGenerator { (dataset, key) => dataset.getValue(key).toString } chart.labelGenerator = PieLabelGenerator(_.getValue(_).toString) chart.labelGenerator = PieLabelGenerator(value => value.toString) chart.labelGenerator = PieLabelGenerator(_.toString) chart.labelGenerator = PieLabelGenerator.Default
-
object
PieToolTipGenerators
extends PieToolTipGenerators
PieToolTipGenerators contains factories for creating tool tip generators for pie charts.
PieToolTipGenerators contains factories for creating tool tip generators for pie charts.
chart.tooltipGenerator = PieToolTipGenerator(value => value.toString)
The following list contains various ways on how to create and set tool tip generators for pie charts:
val data = for (i <- 1 to 5) yield (i,i) val chart = PieChart(data) chart.tooltipGenerator = (dataset: PieDataset, key: Comparable[_]) => dataset.getValue(key).toString chart.tooltipGenerator = PieToolTipGenerator { (dataset, key) => dataset.getValue(key).toString } chart.tooltipGenerator = PieToolTipGenerator(_.getValue(_).toString) chart.tooltipGenerator = PieToolTipGenerator(value => value.toString) chart.tooltipGenerator = PieToolTipGenerator(_.toString) chart.tooltipGenerator = PieToolTipGenerator.Default
-
object
RichChartingCollections
extends RichChartingCollections
Contains enrichments for collections for conversions to datasets.
Contains enrichments for collections for conversions to datasets. To see which conversions are provided have a look at the classes defined below.
-
object
RichPlot
extends RichPlot
RichPlot contains enriched plot types to conveniently work with the plot domain, range and marking.
RichPlot contains enriched plot types to conveniently work with the plot domain, range and marking.
chart.plot.domain.axis.label.text = "my label" chart.plot.range.markers += ((1,1))
Marking
There are enrichments concerning the handling of markers in plots:
chart.plot.domain.markers += 1 chart.plot.range.markers += ((1,1)) for (marker <- chart.plot.range.markers) { // do something with marker }
Marker Conversions
MarkerConversions contains type class based conversions from certain types to
Marker
instances.chart.plot.domain.markers += 1
-
object
SpiderWebChartFactory
extends SpiderWebChartFactory
Contains factories to create spider web charts aka radar charts.
-
object
TableXYDatasetConversions
extends TableXYDatasetConversions
Provides converters for
TableXYDatasets
. -
object
ToolTipGenerators
extends ToolTipGenerators
ToolTipGenerators contains means to conveniently create tool tip generators for all supported chart types.
ToolTipGenerators contains means to conveniently create tool tip generators for all supported chart types.
val chart = PieChart(data) chart.tooltipGenerator = PieToolTipGenerator(value => value.toString)
Tool Tips for Category Charts
CategoryToolTipGenerators contains factories for creating tool tip generators for category charts.
chart.tooltipGenerator = CategoryToolTipGenerator(value => value.toString)
Tool Tips for Pie-like Charts
PieToolTipGenerators contains factories for creating tool tip generators for pie charts.
chart.tooltipGenerator = PieToolTipGenerator(value => value.toString)
Tool Tips for XY Charts
XYToolTipGenerators contains factories for creating tool tip generators for xy charts.
chart.tooltipGenerator = XYToolTipGenerator(value => value.toString)
-
object
XYChartFactories
extends XYChartFactories
XYChartFactories contains all high-level factories to conveniently create xy charts.
-
object
XYDatasetConversions
extends XYDatasetConversions
Provides converters for datasets used for xy charts.
-
object
XYLabelGenerators
extends XYLabelGenerators
XYLabelGenerators contains factories for creating label generators for xy charts.
XYLabelGenerators contains factories for creating label generators for xy charts.
chart.labelGenerator = XYLabelGenerator(value => value.toString)
The following list contains various ways on how to create and set label generators for xy charts:
val data = for (i <- 1 to 5) yield (i,i) val chart = XYLineChart(data) chart.labelGenerator = (dataset: XYDataset, series: Comparable[_], item: Int) => val idx = dataset.indexOf(series) dataset.getY(idx, item).toString } chart.labelGenerator = XYLabelGenerator { (dataset, series, item) => val idx = dataset.indexOf(series) dataset.getY(idx,item).toString } chart.labelGenerator = XYLabelGenerator(value => value.toString) chart.labelGenerator = XYLabelGenerator(_.toString) chart.labelGenerator = XYLabelGenerator((x,y) => s"""($x,$y)""") chart.labelGenerator = XYLabelGenerator.Default
-
object
XYToolTipGenerators
extends XYToolTipGenerators
XYToolTipGenerators contains factories for creating tool tip generators for xy charts.
XYToolTipGenerators contains factories for creating tool tip generators for xy charts.
chart.tooltipGenerator = XYToolTipGenerator(value => value.toString)
The following list contains various ways on how to create and set tool tip generators for xy charts:
val data = for (i <- 1 to 5) yield (i,i) val chart = XYLineChart(data) chart.tooltipGenerator = (dataset: XYDataset, series: Comparable[_], item: Int) => val idx = dataset.indexOf(series) dataset.getY(idx, item).toString } chart.tooltipGenerator = XYToolTipGenerator { (dataset, series, item) => val idx = dataset.indexOf(series) dataset.getY(idx,item).toString } chart.tooltipGenerator = XYToolTipGenerator(value => value.toString) chart.tooltipGenerator = XYToolTipGenerator(_.toString) chart.tooltipGenerator = XYToolTipGenerator((x,y) => s"""($x,$y)""") chart.tooltipGenerator = XYToolTipGenerator.Default