mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#857 Added title to time axis
This commit is contained in:
parent
52d49db82a
commit
422fb90df2
@ -235,10 +235,28 @@ void RimSummaryPlot::updateTimeAxis()
|
|||||||
{
|
{
|
||||||
if (!m_qwtPlot) return;
|
if (!m_qwtPlot) return;
|
||||||
|
|
||||||
QFont timeAxisFont = m_qwtPlot->axisFont(QwtPlot::xBottom);
|
{
|
||||||
timeAxisFont.setBold(false);
|
QString axisTitle;
|
||||||
timeAxisFont.setPixelSize(m_timeAxisProperties->fontSize);
|
if (m_timeAxisProperties->showTitle) axisTitle = m_timeAxisProperties->title();
|
||||||
m_qwtPlot->setAxisFont(QwtPlot::xBottom, timeAxisFont);
|
|
||||||
|
QwtText timeAxisTitle = m_qwtPlot->axisTitle(QwtPlot::xBottom);
|
||||||
|
|
||||||
|
QFont font = timeAxisTitle.font();
|
||||||
|
font.setBold(true);
|
||||||
|
font.setPixelSize(m_timeAxisProperties->fontSize);
|
||||||
|
timeAxisTitle.setFont(font);
|
||||||
|
|
||||||
|
timeAxisTitle.setText(axisTitle);
|
||||||
|
|
||||||
|
m_qwtPlot->setAxisTitle(QwtPlot::xBottom, timeAxisTitle);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
QFont timeAxisFont = m_qwtPlot->axisFont(QwtPlot::xBottom);
|
||||||
|
timeAxisFont.setBold(false);
|
||||||
|
timeAxisFont.setPixelSize(m_timeAxisProperties->fontSize);
|
||||||
|
m_qwtPlot->setAxisFont(QwtPlot::xBottom, timeAxisFont);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -34,6 +34,8 @@ RimSummaryTimeAxisProperties::RimSummaryTimeAxisProperties()
|
|||||||
{
|
{
|
||||||
CAF_PDM_InitObject("Time Axis", ":/SummaryPlot16x16.png", "", "");
|
CAF_PDM_InitObject("Time Axis", ":/SummaryPlot16x16.png", "", "");
|
||||||
|
|
||||||
|
CAF_PDM_InitField(&showTitle, "ShowTitle", false, "Show Title", "", "", "");
|
||||||
|
CAF_PDM_InitField(&title, "Title", QString("Time"), "Title", "", "", "");
|
||||||
CAF_PDM_InitField(&fontSize, "FontSize", 11, "Font Size", "", "", "");
|
CAF_PDM_InitField(&fontSize, "FontSize", 11, "Font Size", "", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&m_visibleRangeMax, "VisibleRangeMax", "Max", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_visibleRangeMax, "VisibleRangeMax", "Max", "", "", "");
|
||||||
|
@ -39,6 +39,8 @@ public:
|
|||||||
RimSummaryTimeAxisProperties();
|
RimSummaryTimeAxisProperties();
|
||||||
|
|
||||||
caf::PdmField<int> fontSize;
|
caf::PdmField<int> fontSize;
|
||||||
|
caf::PdmField<QString> title;
|
||||||
|
caf::PdmField<bool> showTitle;
|
||||||
|
|
||||||
double visibleRangeMin() const;
|
double visibleRangeMin() const;
|
||||||
double visibleRangeMax() const;
|
double visibleRangeMax() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user