Last modified: 2012-06-05 00:36:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29063, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27063 - [jqplotbar] Patch to add 'Show Point Labels'
[jqplotbar] Patch to add 'Show Point Labels'
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
SemanticResultFormats (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: denny vrandecic
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-31 11:29 UTC by planetenxin
Modified: 2012-06-05 00:36 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description planetenxin 2011-01-31 11:29:28 UTC
Hi,

I had a use case where I needed point labels beside the bars. I made a small patch based on 1.5.2.1 release of SRF to get this done.

- [ADD] a new parameter 'showpointlabels' of type boolean.
- [ADD] file jqplot.pointLabels.js to repository


Example:

{{#ask: [[Category:Issue]] 
|?Subject
|?Estimated Hours
|mainlabel=-
|format=jqplotbar
|bardirection=horizontal
|showpointlabels=true
}}


Here's the patch:

*** SRF_jqPlotBar.php.orig	Mon Jan 31 12:03:23 2011
--- SRF_jqPlotBar.php	Mon Jan 31 12:04:23 2011
***************
*** 17,22 ****
--- 17,23 ----
  	protected $m_barcolor = '#85802b' ;
  	protected $m_bardirection = 'vertical';
  	protected $m_numbersaxislabel = ' ';
+ 	protected $m_showpointlabels = 'false';
  	static protected $m_barchartnum = 1;
  
  	protected function readParameters( $params, $outputmode ) {
***************
*** 46,51 ****
--- 47,57 ----
  		if ( array_key_exists( 'numbersaxislabel', $this->m_params ) ) {
  		      $this->m_numbersaxislabel = $this->m_params['numbersaxislabel'];
  		}
+ 		if ( array_key_exists( 'showpointlabels', $this->m_params ) ) {
+ 			if ( $this->m_params['showpointlabels'] == 'true' ) {
+ 				$this->m_showpointlabels['showpointlabels'] = $this->m_params['showpointlabels'];
+ 			}
+ 		}
  	}
  
  	public function getName() {
***************
*** 76,81 ****
--- 82,88 ----
  				'jqplot.barRenderer.min.js',
  				'jqplot.canvasAxisTickRenderer.min.js',
  				'jqplot.canvasTextRenderer.min.js',
+ 				'jqplot.pointLabels.js',
  			),
  			'styles' => array(
  			),
***************
*** 125,130 ****
--- 132,138 ----
  		$scripts[] = "$srfgScriptPath/jqPlot/jqplot.barRenderer.min.js";
  		$scripts[] = "$srfgScriptPath/jqPlot/jqplot.canvasAxisTickRenderer.min.js";
  		$scripts[] = "$srfgScriptPath/jqPlot/jqplot.canvasTextRenderer.min.js";
+ 		$scripts[] = "$srfgScriptPath/jqPlot/jqplot.pointLabels.js";
  
  		foreach ( $scripts as $script ) {
  			$wgOut->addScriptFile( $script );
***************
*** 248,254 ****
  				barDirection: '{$this->m_bardirection}',
  				barPadding: 6,
  				barMargin: $barmargin
! 			}
  		}],
  		axes: {
  			$labels_axis: {
--- 256,262 ----
  				barDirection: '{$this->m_bardirection}',
  				barPadding: 6,
  				barMargin: $barmargin
! 			}, pointLabels:{show: '{$this->m_showpointlabels}'}
  		}],
  		axes: {
  			$labels_axis: {
Comment 1 MWJames 2012-06-05 00:36:12 UTC
Parameter['pointlabels'] had been introduced in SRF 1.7/SRF 1.8 for both jqPlotBar/Pie and since its changes in SRF 1.8, this patch is obsolete.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links