# class toLineChart

A widget that displays a linechart with optional background throbber (Not implemented yet). More...

Definition | `#include <tolinechart.h>`
Inherits | QWidget (qt) [public ]
Inherited by | toBarChart, toResultBar, toResultLine
List of all Methods

Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- toLineChart (QWidget *parent=NULL,const char *name=NULL,WFlags f=0)
- toLineChart (toLineChart *chart,QWidget *parent=NULL,const char *name=NULL,WFlags f=0)
- void showLegend (bool on)
- bool legend (void) const
- void showLast (bool on)
- bool last (void) const
- void setTitle (const QString &title=QString::null)
- const QString & title (void)
- void showGrid (int div=0)
- int grid (void) const
- void showAxisLegend (bool on)
- bool axisLegend (void) const
- void setYPostfix (const QString &postfix)
- void setMaxValueAuto (void)
- void setMinValueAuto (void)
- void setMaxValue (double maxVal)
- void setMinValue (double minVal)
- double minValue (void) const
- double maxValue (void) const
- void setSamples (int samples=-1)
- int samples (void) const
- void setLabels (const std::list<QString> &labels)
- std::list<QString> & labels (void)
- virtual void addValues (std::list<double> &value,const QString &xValues)
- std::list<QString> & xValues (void)
- std::list<std::list<double> > & values (void)

#### Public Slots

- virtual void clear (void)
- virtual void setup (void)
- virtual void editPrint (void)
- virtual void openCopy (void)

#### Protected Methods

- QRect fixRect (QPoint p1,QPoint p2)
- virtual void mouseReleaseEvent (QMouseEvent *e)
- virtual void mouseMoveEvent (QMouseEvent *e)
- virtual void mouseDoubleClickEvent (QMouseEvent *e)
- virtual void mousePressEvent (QMouseEvent *e)
- int countSamples (void)
- void clearZoom (void)
- virtual void paintLegend (QPainter *p,QRect &rect)
- virtual void paintTitle (QPainter *p,QRect &rect)
- virtual void paintAxis (QPainter *p,QRect &rect)
- virtual void paintChart (QPainter *p,QRect &rect)
- virtual void paintEvent (QPaintEvent *e)

#### Protected Static Methods

- static double round (double round,bool up)

#### Protected Members

- std::list<std::list<double> > Values
- std::list<QString> XValues
- std::list<QString> Labels
- bool Legend
- bool Last
- int Grid
- bool AxisText
- double MinValue
- bool MinAuto
- double MaxValue
- bool MaxAuto
- QString YPostfix
- int Samples
- QString Title
- QRect Chart
- QPoint MousePoint[2]
- int SkipSamples
- int UseSamples
- bool Zooming
- double zMinValue
- double zMaxValue

## Detailed Description

A widget that displays a linechart with optional background throbber (Not implemented yet).

std::list<std::list<double> > Values

### Values

[protected]

std::list<QString> XValues

### XValues

[protected]

std::list<QString> Labels

### Labels

[protected]

bool Legend

### Legend

[protected]

bool Last

### Last

[protected]

int Grid

### Grid

[protected]

bool AxisText

### AxisText

[protected]

double MinValue

### MinValue

[protected]

bool MinAuto

### MinAuto

[protected]

double MaxValue

### MaxValue

[protected]

bool MaxAuto

### MaxAuto

[protected]

QString YPostfix

### YPostfix

[protected]

int Samples

### Samples

[protected]

QString Title

### Title

[protected]

QRect Chart

### Chart

[protected]

QPoint MousePoint[2]

### MousePoint[2]

[protected]

int SkipSamples

### SkipSamples

[protected]

int UseSamples

### UseSamples

[protected]

bool Zooming

### Zooming

[protected]

double zMinValue

### zMinValue

[protected]

double zMaxValue

### zMaxValue

[protected]

double round (double round,bool up)

### round

[protected static]

QRect fixRect (QPoint p1,QPoint p2)

### fixRect

[protected]

void mouseReleaseEvent (QMouseEvent *e)

### mouseReleaseEvent

[protected virtual]

Reimplemented from QWidget.

void mouseMoveEvent (QMouseEvent *e)

### mouseMoveEvent

[protected virtual]

Reimplemented from QWidget.

void mouseDoubleClickEvent (QMouseEvent *e)

### mouseDoubleClickEvent

[protected virtual]

Reimplemented from QWidget.

void mousePressEvent (QMouseEvent *e)

### mousePressEvent

[protected virtual]

Reimplemented from QWidget.

int countSamples (void)

### countSamples

[protected]

void clearZoom (void)

### clearZoom

[protected]

void paintLegend (QPainter *p,QRect &rect)

### paintLegend

[protected virtual]

void paintTitle (QPainter *p,QRect &rect)

### paintTitle

[protected virtual]

void paintAxis (QPainter *p,QRect &rect)

### paintAxis

[protected virtual]

void paintChart (QPainter *p,QRect &rect)

### paintChart

[protected virtual]

toLineChart (QWidget *parent=NULL,const char *name=NULL,WFlags f=0)

### toLineChart

Create a new linechart.

Parameters:

parent | Parent widget.
name | Name of widget.
f | Widget flags.

toLineChart (toLineChart *chart,QWidget *parent=NULL,const char *name=NULL,WFlags f=0)

### toLineChart

Create a new chart by copying all the data from another chart.

Parameters:

chart | Chart to copy data from.
parent | Parent widget.
name | Name of widget.
f | Widget flags.

void showLegend (bool on)

### showLegend

Specify if legend should be displayed to the right of the graph, default is on.

Parameters:

on | Whether to display legend or not.

bool legend (void)

### legend

[const]

Check if legend is displayed or not.

Returns: If legend is displayed or not.

void showLast (bool on)

### showLast

Show most recent value on top of graph

Parameters:

on | Whether to display or not.

bool last (void)

### last

[const]

Check if last value is displayed or not.

Returns: If value is displayed or not.

void setTitle (const QString &title=QString::null)

### setTitle

Set title of the chart. Set to empty string to not display title.

Parameters:

title | Title of chart.

const QString & title (void)

### title

Get title of chart.

Returns: Title of chart.

void showGrid (int div=0)

### showGrid

Specify if a grid should be displayed in the graph, default is on.

Parameters:

div | Number of parts to divide grid into.

int grid (void)

### grid

[const]

Check if grid is displayed or not.

Returns: Number of parts to divide grid into.

void showAxisLegend (bool on)

### showAxisLegend

Specify if a y-axis legend should be displayed in the graph, default is on.

Parameters:

on | Whether to display legend or not.

bool axisLegend (void)

### axisLegend

[const]

Check if y-axis legend is displayed or not.

Returns: If legend is displayed or not.

void setYPostfix (const QString &postfix)

### setYPostfix

Set y postfix value. This will be appended to the values in the axis legend.

Parameters:

postfix | The string to append.

void setMaxValueAuto (void)

### setMaxValueAuto

Set max value on y-axis to auto.

void setMinValueAuto (void)

### setMinValueAuto

Set min value on y-axis to auto.

void setMaxValue (double maxVal)

### setMaxValue

Set max value on y-axis.

Parameters:

val | Max value on y-axis.

void setMinValue (double minVal)

### setMinValue

Set min value on y-axis.

Parameters:

val | Min value on y-axis.

double minValue (void)

### minValue

[const]

Get minimum value on y-axis. Will not return the automatically determinned minimum value.

Returns: Minimum value on y-axis.

double maxValue (void)

### maxValue

[const]

Get maximum value on y-axis. Will not return the automatically determinned maximum value.

Returns: Maximum value on y-axis.

void setSamples (int samples=-1)

### setSamples

Set the number of samples on the x-axis. Setting samples to -1 will keep all entries.

Parameters:

samples | Number of samples.

int samples (void)

### samples

[const]

Get the maximum number of samples on the x-axis.

Returns: Max number of samples.

void setLabels (const std::list<QString> &labels)

### setLabels

Set the labels on the chart lines.

Parameters:

labels | Labels of the lines. Empty labels will not show up in the legend.

std::list<QString> & labels (void)

### labels

Get the labels of the chart lines.

Returns: List of labels.

void addValues (std::list<double> &value,const QString &xValues)

### addValues

[virtual]

Add a new value set to the chart.

Parameters:

value | New values for charts (One for each line).
label | X-value on these values.

std::list<QString> & xValues (void)

### xValues

Get list of labels

Returns: List of labels

std::list<std::list<double> > & values (void)

### values

Get list of values.

Returns: Values in piechart.

void clear (void)

### clear

[virtual slot]

Clear the values from the chart.

void setup (void)

### setup

[virtual slot]

Setup values of charts.

void editPrint (void)

### editPrint

[virtual slot]

Print the chart.

void openCopy (void)

### openCopy

[virtual slot]

Open chart in new window.

void paintEvent (QPaintEvent *e)

### paintEvent

[protected virtual]

Reimplemented for internal reasons.

Reimplemented from QWidget.