File indexing completed on 2024-11-24 03:57:45
0001 /** 0002 * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved. 0003 * 0004 * This file is part of the KD Chart library. 0005 * 0006 * SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #include "AdjustedCartesianAxis.h" 0010 0011 0012 AdjustedCartesianAxis::AdjustedCartesianAxis ( KChart::AbstractCartesianDiagram* diagram ) 0013 : CartesianAxis ( diagram ) 0014 , m_lowerBound(0.0) 0015 , m_upperBound(0.0) 0016 { 0017 // this block left empty intentionally 0018 } 0019 0020 const QString AdjustedCartesianAxis::customizedLabel( const QString& label ) const 0021 { 0022 bool bOK; 0023 qreal val = label.toDouble( & bOK ); 0024 if ( bOK ) { 0025 if ( val < m_lowerBound ) 0026 return tr("LOW"); 0027 else if ( val > m_upperBound ) 0028 return tr("HIGH"); 0029 } 0030 return label; 0031 }