Hi Nathan,
Here is a little patch that add an anti aliasing option per graph. The
option is also saved in the view.
See attached patch and saved view...
I'm actually working on the layout of tabs, first by adding a column
option that would let the user split the tab also vertically.
Bye
Olivier
Nathan Scott wrote:
> Changes committed to git://oss.sgi.com:8090/nathans/kmchart.git
>
> README | 1 -
> src/time/timelord.cpp | 7 +++++++
> src/time/timelord.h | 4 +++-
> 3 files changed, 10 insertions(+), 2 deletions(-)
>
> commit af8c3f609442b93f2337fd451233daa897bb6451
> Author: Nathan Scott <nathans@xxxxxxxxxx>
> Date: Fri Oct 19 17:17:03 2007 +1000
>
> Resolve long-standing issue with occassionally-leaked kmtime
> processes.
>
>
>
>
>
diff --git a/src/chart/chart.cpp b/src/chart/chart.cpp
index 1da39f5..5fc4178 100644
--- a/src/chart/chart.cpp
+++ b/src/chart/chart.cpp
@@ -45,6 +45,7 @@ Chart::Chart(Tab *chartTab, QWidget *parent) : QwtPlot(parent)
canvas()->setPaintAttribute(QwtPlotCanvas::PaintPacked, true);
enableAxis(xBottom, false);
setLegendVisible(true);
+
legend()->contentsWidget()->setFont(globalFont);
connect(this, SIGNAL(legendChecked(QwtPlotItem *, bool)),
SLOT(showCurve(QwtPlotItem *, bool)));
@@ -595,6 +596,12 @@ void Chart::setStroke(Plot *plot, Style style, QColor
color)
console->post("Chart::setStroke [style %d->%d]", my.style, style);
plot->color = color;
+ if (my.antiAliasing) {
+ plot->curve->setRenderHint(QwtPlotItem::RenderAntialiased, true);
+ }
+ else {
+ plot->curve->setRenderHint(QwtPlotItem::RenderAntialiased, false);
+ }
switch (style) {
case BarStyle:
@@ -656,7 +663,6 @@ void Chart::setStroke(Plot *plot, Style style, QColor color)
plot->curve->setBrush(QBrush(Qt::NoBrush));
plot->curve->setStyle(isStepped(plot) ?
QwtPlotCurve::Steps : QwtPlotCurve::Lines);
- plot->curve->setRenderHint(QwtPlotItem::RenderAntialiased);
if (my.style != LineStyle) {
// Need to undo any munging of plotData[]
@@ -843,6 +849,21 @@ void Chart::setLegendVisible(bool on)
}
}
+
+bool Chart::useAntiAliasing()
+{
+ // Legend is on or off for all plots, only need to test the first plot
+ return my.antiAliasing;
+}
+
+void Chart::setAntiAliasing(bool on)
+{
+ console->post("Chart::setAntiAliasingOn(%d) antiAliasing()=%p", on,
useAntiAliasing());
+ my.antiAliasing=on;
+}
+
+
+
QString Chart::name(int m)
{
return my.plots[m]->name;
diff --git a/src/chart/chart.h b/src/chart/chart.h
index dd619d9..7757fbf 100644
--- a/src/chart/chart.h
+++ b/src/chart/chart.h
@@ -75,6 +75,8 @@ public:
void setYAxisTitle(char *);
bool legendVisible();
void setLegendVisible(bool);
+ bool useAntiAliasing();
+ void setAntiAliasing(bool);
void update(bool, bool, bool);
@@ -134,6 +136,7 @@ private:
QString scheme;
int sequence;
bool autoScale;
+ bool antiAliasing;
double yMin;
double yMax;
QwtPlotPicker *picker;
diff --git a/src/chart/chartdialog.cpp b/src/chart/chartdialog.cpp
index 46e6e9f..ac9fa88 100644
--- a/src/chart/chartdialog.cpp
+++ b/src/chart/chartdialog.cpp
@@ -98,6 +98,8 @@ void ChartDialog::reset(Chart *chart, int style, QString
scheme)
setupSchemeComboBox();
legendOn->setChecked(true);
legendOff->setChecked(false);
+ antiAliasingOn->setChecked(true);
+ antiAliasingOff->setChecked(false);
setupAvailableMetricsTree(my.archiveSource);
my.yMin = yAxisMinimum->value();
my.yMax = yAxisMaximum->value();
@@ -378,6 +380,25 @@ void ChartDialog::legendOffClicked()
legendOff->setChecked(true);
}
+bool ChartDialog::antiAliasing(void)
+{
+ return antiAliasingOn->isChecked();
+}
+
+void ChartDialog::antiAliasingOnClicked()
+{
+ antiAliasingOn->setChecked(true);
+ antiAliasingOff->setChecked(false);
+}
+
+void ChartDialog::antiAliasingOffClicked()
+{
+ antiAliasingOn->setChecked(false);
+ antiAliasingOff->setChecked(true);
+}
+
+
+
void ChartDialog::scheme(QString *scheme, int *sequence)
{
*scheme = my.scheme;
@@ -390,6 +411,7 @@ void ChartDialog::setScheme(QString scheme, int sequence)
my.sequence = sequence;
}
+
void ChartDialog::scale(bool *autoScale, double *yMin, double *yMax)
{
*autoScale = autoScaleOn->isChecked();
diff --git a/src/chart/chartdialog.h b/src/chart/chartdialog.h
index f05114a..97018cd 100644
--- a/src/chart/chartdialog.h
+++ b/src/chart/chartdialog.h
@@ -29,6 +29,7 @@ public:
virtual Chart *chart(void);
virtual QString title(void);
virtual bool legend(void);
+ virtual bool antiAliasing(void);
virtual void scale(bool *, double *, double *);
virtual void setScale(bool, double, double);
virtual void scheme(QString *, int *);
@@ -63,6 +64,8 @@ public slots:
virtual void sourceButtonClicked();
virtual void legendOnClicked();
virtual void legendOffClicked();
+ virtual void antiAliasingOnClicked();
+ virtual void antiAliasingOffClicked();
virtual void autoScaleOnClicked();
virtual void autoScaleOffClicked();
virtual void yAxisMinimumValueChanged(double);
diff --git a/src/chart/chartdialog.ui b/src/chart/chartdialog.ui
index 464ae1b..a540634 100644
--- a/src/chart/chartdialog.ui
+++ b/src/chart/chartdialog.ui
@@ -238,6 +238,130 @@
</property>
</widget>
</item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="antiAliasingTextLabel" >
+ <property name="text" >
+ <string>Antialiasing:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" >
+ <widget class="QWidget" native="1" name="antiAliasingContainer" >
+ <layout class="QHBoxLayout" >
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="antiAliasingOn" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>On</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="antiAliasingOff" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Off</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
<item row="0" column="1" >
<widget class="QLineEdit" name="titleLineEdit" />
</item>
diff --git a/src/chart/kmchart.cpp b/src/chart/kmchart.cpp
index fee9efc..6b3b5b1 100644
--- a/src/chart/kmchart.cpp
+++ b/src/chart/kmchart.cpp
@@ -461,6 +461,7 @@ void KmChart::acceptNewChart()
if (newTitle.isEmpty() == false)
cp->changeTitle(newTitle, true);
cp->setLegendVisible(my.newchart->legend());
+ cp->setAntiAliasing(my.newchart->antiAliasing());
if (my.newchart->setupChartPlotsShortcut(cp) == false)
my.newchart->setupChartPlots(cp);
my.newchart->scale(&yAutoScale, &yMin, &yMax);
@@ -492,6 +493,8 @@ void KmChart::editChart()
my.editchart->titleLineEdit->setText(cp->title());
my.editchart->legendOn->setChecked(cp->legendVisible());
my.editchart->legendOff->setChecked(!cp->legendVisible());
+ my.editchart->antiAliasingOn->setChecked(cp->useAntiAliasing());
+ my.editchart->antiAliasingOff->setChecked(!cp->useAntiAliasing());
cp->scale(&yAutoScale, &yMin, &yMax);
my.editchart->setScale(yAutoScale, yMin, yMax);
my.editchart->setScheme(cp->scheme(), cp->sequence());
@@ -510,6 +513,7 @@ void KmChart::acceptEditChart()
if (editTitle.isEmpty() == false && editTitle != cp->title())
cp->changeTitle(editTitle, true);
cp->setLegendVisible(my.editchart->legend());
+ cp->setAntiAliasing(my.editchart->antiAliasing());
my.editchart->scale(&yAutoScale, &yMin, &yMax);
cp->setScale(yAutoScale, yMin, yMax);
my.editchart->setupChartPlots(cp);
diff --git a/src/chart/view.cpp b/src/chart/view.cpp
index f6189c8..f9b2ec3 100644
--- a/src/chart/view.cpp
+++ b/src/chart/view.cpp
@@ -423,6 +423,7 @@ new_chart:
double ymin = 0;
double ymax = 0;
int legend = 1;
+ int antialias = 0;
if ((w = getwd(f)) == NULL || w[0] == '\n') {
xpect("title\" or \"style", w);
@@ -519,6 +520,22 @@ new_chart:
if ((w = getwd(f)) == NULL || w[0] == '\n')
goto done_chart;
}
+ if (strcasecmp(w, "antialiasing") == 0) {
+ // optional antialiasing on|off
+ if ((w = getwd(f)) == NULL || w[0] == '\n') {
+ antialias = 1;
+ }
+ if (strcasecmp(w, "on") == 0)
+ antialias = 1;
+ else if (strcasecmp(w, "off") == 0)
+ antialias = 0;
+ else {
+ xpect("on\" or \"off", w);
+ goto abort_chart;
+ }
+ if ((w = getwd(f)) == NULL || w[0] == '\n')
+ goto done_chart;
+ }
done_chart:
if (pmDebug & DBG_TRACE_APPL2) {
fprintf(stderr, "openView: new chart: style=%s",
@@ -531,6 +548,8 @@ done_chart:
fprintf(stderr, " ymin=%.1f ymax=%.1f", ymin, ymax);
if (legend)
fprintf(stderr, " legend=yes");
+ if (antialias)
+ fprintf(stderr, " antialias=yes");
fputc('\n', stderr);
}
if (Cflag == 0 || Cflag == 2) {
@@ -541,6 +560,8 @@ done_chart:
cp->changeTitle(title, mode == M_KMCHART);
if (legend == 0)
cp->setLegendVisible(false);
+ if (antialias == 1)
+ cp->setAntiAliasing(true);
}
state = S_CHART;
if (title != NULL) free(title);
@@ -1133,6 +1154,9 @@ bool SaveViewDialog::saveView(QString file, bool
hostDynamic, bool sizeDynamic)
break;
}
fprintf(f, " style %s", p);
+ if (cp->useAntiAliasing()) {
+ fprintf(f, " antialiasing on");
+ }
if (cp->style() != Chart::UtilisationStyle) {
cp->scale(&autoscale, &ymin, &ymax);
if (!autoscale)
Warning: 11 paths touched but unmodified. Consider running git-status.
diff --git a/src/chart/chart.cpp b/src/chart/chart.cpp
index 1da39f5..63b3b18 100644
--- a/src/chart/chart.cpp
+++ b/src/chart/chart.cpp
@@ -595,6 +595,12 @@ void Chart::setStroke(Plot *plot, Style style, QColor
color)
console->post("Chart::setStroke [style %d->%d]", my.style, style);
plot->color = color;
+ if (my.antiAliasing) {
+ plot->curve->setRenderHint(QwtPlotItem::RenderAntialiased, true);
+ }
+ else {
+ plot->curve->setRenderHint(QwtPlotItem::RenderAntialiased, false);
+ }
switch (style) {
case BarStyle:
@@ -656,7 +662,6 @@ void Chart::setStroke(Plot *plot, Style style, QColor color)
plot->curve->setBrush(QBrush(Qt::NoBrush));
plot->curve->setStyle(isStepped(plot) ?
QwtPlotCurve::Steps : QwtPlotCurve::Lines);
- plot->curve->setRenderHint(QwtPlotItem::RenderAntialiased);
if (my.style != LineStyle) {
// Need to undo any munging of plotData[]
@@ -843,6 +848,21 @@ void Chart::setLegendVisible(bool on)
}
}
+
+bool Chart::useAntiAliasing()
+{
+ // Legend is on or off for all plots, only need to test the first plot
+ return my.antiAliasing;
+}
+
+void Chart::setAntiAliasing(bool on)
+{
+ console->post("Chart::setAntiAliasingOn(%d) antiAliasing()=%p", on,
useAntiAliasing());
+ my.antiAliasing=on;
+}
+
+
+
QString Chart::name(int m)
{
return my.plots[m]->name;
diff --git a/src/chart/chart.h b/src/chart/chart.h
index dd619d9..7757fbf 100644
--- a/src/chart/chart.h
+++ b/src/chart/chart.h
@@ -75,6 +75,8 @@ public:
void setYAxisTitle(char *);
bool legendVisible();
void setLegendVisible(bool);
+ bool useAntiAliasing();
+ void setAntiAliasing(bool);
void update(bool, bool, bool);
@@ -134,6 +136,7 @@ private:
QString scheme;
int sequence;
bool autoScale;
+ bool antiAliasing;
double yMin;
double yMax;
QwtPlotPicker *picker;
diff --git a/src/chart/chartdialog.cpp b/src/chart/chartdialog.cpp
index 46e6e9f..ac9fa88 100644
--- a/src/chart/chartdialog.cpp
+++ b/src/chart/chartdialog.cpp
@@ -98,6 +98,8 @@ void ChartDialog::reset(Chart *chart, int style, QString
scheme)
setupSchemeComboBox();
legendOn->setChecked(true);
legendOff->setChecked(false);
+ antiAliasingOn->setChecked(true);
+ antiAliasingOff->setChecked(false);
setupAvailableMetricsTree(my.archiveSource);
my.yMin = yAxisMinimum->value();
my.yMax = yAxisMaximum->value();
@@ -378,6 +380,25 @@ void ChartDialog::legendOffClicked()
legendOff->setChecked(true);
}
+bool ChartDialog::antiAliasing(void)
+{
+ return antiAliasingOn->isChecked();
+}
+
+void ChartDialog::antiAliasingOnClicked()
+{
+ antiAliasingOn->setChecked(true);
+ antiAliasingOff->setChecked(false);
+}
+
+void ChartDialog::antiAliasingOffClicked()
+{
+ antiAliasingOn->setChecked(false);
+ antiAliasingOff->setChecked(true);
+}
+
+
+
void ChartDialog::scheme(QString *scheme, int *sequence)
{
*scheme = my.scheme;
@@ -390,6 +411,7 @@ void ChartDialog::setScheme(QString scheme, int sequence)
my.sequence = sequence;
}
+
void ChartDialog::scale(bool *autoScale, double *yMin, double *yMax)
{
*autoScale = autoScaleOn->isChecked();
diff --git a/src/chart/chartdialog.h b/src/chart/chartdialog.h
index f05114a..97018cd 100644
--- a/src/chart/chartdialog.h
+++ b/src/chart/chartdialog.h
@@ -29,6 +29,7 @@ public:
virtual Chart *chart(void);
virtual QString title(void);
virtual bool legend(void);
+ virtual bool antiAliasing(void);
virtual void scale(bool *, double *, double *);
virtual void setScale(bool, double, double);
virtual void scheme(QString *, int *);
@@ -63,6 +64,8 @@ public slots:
virtual void sourceButtonClicked();
virtual void legendOnClicked();
virtual void legendOffClicked();
+ virtual void antiAliasingOnClicked();
+ virtual void antiAliasingOffClicked();
virtual void autoScaleOnClicked();
virtual void autoScaleOffClicked();
virtual void yAxisMinimumValueChanged(double);
diff --git a/src/chart/chartdialog.ui b/src/chart/chartdialog.ui
index 464ae1b..a540634 100644
--- a/src/chart/chartdialog.ui
+++ b/src/chart/chartdialog.ui
@@ -238,6 +238,130 @@
</property>
</widget>
</item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="antiAliasingTextLabel" >
+ <property name="text" >
+ <string>Antialiasing:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" >
+ <widget class="QWidget" native="1" name="antiAliasingContainer" >
+ <layout class="QHBoxLayout" >
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="antiAliasingOn" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>On</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="antiAliasingOff" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Off</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
<item row="0" column="1" >
<widget class="QLineEdit" name="titleLineEdit" />
</item>
diff --git a/src/chart/kmchart.cpp b/src/chart/kmchart.cpp
index fee9efc..6b3b5b1 100644
--- a/src/chart/kmchart.cpp
+++ b/src/chart/kmchart.cpp
@@ -461,6 +461,7 @@ void KmChart::acceptNewChart()
if (newTitle.isEmpty() == false)
cp->changeTitle(newTitle, true);
cp->setLegendVisible(my.newchart->legend());
+ cp->setAntiAliasing(my.newchart->antiAliasing());
if (my.newchart->setupChartPlotsShortcut(cp) == false)
my.newchart->setupChartPlots(cp);
my.newchart->scale(&yAutoScale, &yMin, &yMax);
@@ -492,6 +493,8 @@ void KmChart::editChart()
my.editchart->titleLineEdit->setText(cp->title());
my.editchart->legendOn->setChecked(cp->legendVisible());
my.editchart->legendOff->setChecked(!cp->legendVisible());
+ my.editchart->antiAliasingOn->setChecked(cp->useAntiAliasing());
+ my.editchart->antiAliasingOff->setChecked(!cp->useAntiAliasing());
cp->scale(&yAutoScale, &yMin, &yMax);
my.editchart->setScale(yAutoScale, yMin, yMax);
my.editchart->setScheme(cp->scheme(), cp->sequence());
@@ -510,6 +513,7 @@ void KmChart::acceptEditChart()
if (editTitle.isEmpty() == false && editTitle != cp->title())
cp->changeTitle(editTitle, true);
cp->setLegendVisible(my.editchart->legend());
+ cp->setAntiAliasing(my.editchart->antiAliasing());
my.editchart->scale(&yAutoScale, &yMin, &yMax);
cp->setScale(yAutoScale, yMin, yMax);
my.editchart->setupChartPlots(cp);
diff --git a/src/chart/view.cpp b/src/chart/view.cpp
index f6189c8..f9b2ec3 100644
--- a/src/chart/view.cpp
+++ b/src/chart/view.cpp
@@ -423,6 +423,7 @@ new_chart:
double ymin = 0;
double ymax = 0;
int legend = 1;
+ int antialias = 0;
if ((w = getwd(f)) == NULL || w[0] == '\n') {
xpect("title\" or \"style", w);
@@ -519,6 +520,22 @@ new_chart:
if ((w = getwd(f)) == NULL || w[0] == '\n')
goto done_chart;
}
+ if (strcasecmp(w, "antialiasing") == 0) {
+ // optional antialiasing on|off
+ if ((w = getwd(f)) == NULL || w[0] == '\n') {
+ antialias = 1;
+ }
+ if (strcasecmp(w, "on") == 0)
+ antialias = 1;
+ else if (strcasecmp(w, "off") == 0)
+ antialias = 0;
+ else {
+ xpect("on\" or \"off", w);
+ goto abort_chart;
+ }
+ if ((w = getwd(f)) == NULL || w[0] == '\n')
+ goto done_chart;
+ }
done_chart:
if (pmDebug & DBG_TRACE_APPL2) {
fprintf(stderr, "openView: new chart: style=%s",
@@ -531,6 +548,8 @@ done_chart:
fprintf(stderr, " ymin=%.1f ymax=%.1f", ymin, ymax);
if (legend)
fprintf(stderr, " legend=yes");
+ if (antialias)
+ fprintf(stderr, " antialias=yes");
fputc('\n', stderr);
}
if (Cflag == 0 || Cflag == 2) {
@@ -541,6 +560,8 @@ done_chart:
cp->changeTitle(title, mode == M_KMCHART);
if (legend == 0)
cp->setLegendVisible(false);
+ if (antialias == 1)
+ cp->setAntiAliasing(true);
}
state = S_CHART;
if (title != NULL) free(title);
@@ -1133,6 +1154,9 @@ bool SaveViewDialog::saveView(QString file, bool
hostDynamic, bool sizeDynamic)
break;
}
fprintf(f, " style %s", p);
+ if (cp->useAntiAliasing()) {
+ fprintf(f, " antialiasing on");
+ }
if (cp->style() != Chart::UtilisationStyle) {
cp->scale(&autoscale, &ymin, &ymax);
if (!autoscale)
Warning: 11 paths touched but unmodified. Consider running git-status.
#kmchart
version 1
chart title "CPU Utilization [%h]" style utilization
plot legend "User" color #2d2de2 metric kernel.all.cpu.user
plot legend "Sys" color #e71717 metric kernel.all.cpu.sys
plot legend "Nice" color #c2f3c2 metric kernel.all.cpu.nice
plot legend "Intr" color #cdcd00 metric kernel.all.cpu.intr
plot legend "Wait" color #00cdcd metric kernel.all.cpu.wait.total
plot legend "Idle" color #16d816 metric kernel.all.cpu.idle
chart title "Average Load [%h]" style plot antialiasing on
plot legend "1 min" color #ffff00 metric kernel.all.load instance "1
minute"
plot legend "# cpus" color #0000ff metric hinv.ncpu
chart title "IOPS over all Disks [%h]" style area
plot legend "Reads" color #ffff00 metric disk.all.read
plot legend "Writes" color #ee82ee metric disk.all.write
chart title "Network Interface Bytes [%h]" style stacking
plot legend "in eth0" color #ffff00 metric network.interface.in.bytes
instance "eth0"
plot legend "in sit0" color #0000ff metric network.interface.in.bytes
instance "sit0"
plot legend "in eth2" color #ff0000 metric network.interface.in.bytes
instance "eth2"
plot legend "out eth0" color #008000 metric network.interface.out.bytes
instance "eth0"
plot legend "out sit0" color #ee82ee metric network.interface.out.bytes
instance "sit0"
plot legend "out eth2" color #ffff00 metric network.interface.out.bytes
instance "eth2"
chart title "Real Memory Usage [%h]" style stacking antialiasing on
plot color #000096 metric mem.util.shared
plot color #9cffab metric mem.util.cached
plot color #fe68ad metric mem.util.bufmem
plot color #ffae2c metric mem.util.other
plot color #00ff00 metric mem.util.free
chart title "cpu" style area antialiasing on
plot color #ffff00 metric kernel.all.cpu.idle
plot color #0000ff metric kernel.all.cpu.intr
plot color #ff0000 metric kernel.all.cpu.nice
plot color #008000 metric kernel.all.cpu.sys
plot color #ee82ee metric kernel.all.cpu.user
plot color #ffff00 metric kernel.all.cpu.wait.total
|