|
// +----------------------------------------------------------------------+
/**
* Base class for sidebar settings of linear based charts.
*
* @category Visualizer
* @package Render
* @subpackage Sidebar
*
* @since 1.0.0
* @abstract
*/
abstract class Visualizer_Render_Sidebar_Linear extends Visualizer_Render_Sidebar_Graph {
/**
* Determines whether we need to render curve type option or not.
*
* @since 1.0.0
*
* @access protected
* @var boolean
*/
protected $_includeCurveTypes;
/**
* The array of available curve types.
*
* @since 1.0.0
*
* @access protected
* @var array
*/
protected $_curveTypes;
/**
* Determines whether we need to render focus target option or not.
*
* @since 1.0.0
*
* @access protected
* @var boolean
*/
protected $_includeFocusTarget;
/**
* Constructor.
*
* @since 1.0.0
*
* @access public
* @param array $data The data what has to be associated with this render.
*/
public function __construct( $data = array() ) {
parent::__construct( $data );
$this->_includeCurveTypes = true;
$this->_includeFocusTarget = true;
$this->_curveTypes = array(
'' => '',
'none' => esc_html__( 'Straight line without curve', Visualizer_Plugin::NAME ),
'function' => esc_html__( 'The angles of the line will be smoothed', Visualizer_Plugin::NAME ),
);
}
/**
* Renders general settings block for horizontal axis settings.
*
* @since 1.4.0
*
* @access protected
*/
protected function _renderHorizontalAxisGeneratSettings() {
parent::_renderHorizontalAxisGeneratSettings();
self::_renderTextItem(
esc_html__( 'Number Format', Visualizer_Plugin::NAME ),
'hAxis[format]',
isset( $this->hAxis['format'] ) ? $this->hAxis['format'] : '',
sprintf(
'%s
%s
%s',
esc_html__( 'Enter custom format pattern to apply to horizontal axis labels.', Visualizer_Plugin::NAME ),
sprintf(
esc_html__( 'For number axis labels, this is a subset of the decimal formatting %sICU pattern set%s. For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.', Visualizer_Plugin::NAME ),
'',
''
),
sprintf(
esc_html__( 'For date axis labels, this is a subset of the date formatting %sICU date and time format%s.', Visualizer_Plugin::NAME ),
'',
''
)
)
);
}
/**
* Renders general settings block for vertical axis settings.
*
* @since 1.4.0
*
* @access protected
*/
protected function _renderVerticalAxisGeneralSettings() {
parent::_renderVerticalAxisGeneralSettings();
self::_renderTextItem(
esc_html__( 'Number Format', Visualizer_Plugin::NAME ),
'vAxis[format]',
isset( $this->vAxis['format'] ) ? $this->vAxis['format'] : '',
sprintf(
'%s
%s',
esc_html__( 'Enter custom format pattern to apply to vertical axis labels.', Visualizer_Plugin::NAME ),
sprintf(
esc_html__( 'For number axis labels, this is a subset of the decimal formatting %sICU pattern set%s. For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.', Visualizer_Plugin::NAME ),
'',
''
)
)
);
}
/**
* Renders line settings items.
*
* @since 1.0.0
*
* @access protected
*/
protected function _renderLineSettingsItems() {
echo '
| '; echo ''; echo ' | '; echo ''; echo ''; echo ' | '; echo '
'; esc_html_e( 'Data line width and diameter of displayed points in pixels. Use zero to hide all lines or points.', Visualizer_Plugin::NAME ); echo '
'; echo '| '; $line_width = isset( $this->series[$index]['lineWidth'] ) ? $this->series[$index]['lineWidth'] : ''; echo ''; echo ' | '; echo ''; $point_size = isset( $this->series[$index]['pointSize'] ) ? $this->series[$index]['pointSize'] : ''; echo ''; echo ' | '; echo '
'; esc_html_e( 'Overrides the global line width and point size values for this series.', Visualizer_Plugin::NAME ); echo '
'; echo '