SemanticMediaWiki / SemanticResultFormats

Provides additional visualizations (result formats) for Semantic MediaWiki
https://www.semantic-mediawiki.org/wiki/Extension:Semantic_Result_Formats
Other
45 stars 75 forks source link

jqplotchart label error with DistributionResults and link != none #782

Closed thomas-topway-it closed 1 year ago

thomas-topway-it commented 1 year ago

Setup

Issue

A query like the following


{{#ask:[[Category:Correspondence]][[Numismatic keyword::+]]           
|?Numismatic keyword# 
|format=jqplotchart
|charttype=bar   
|direction=horizontal
|mainlabel=-
|limit=5000
|link=all
|headers=show
|charttitle=Numismatic keywords
|highlighter=yes
|datalabels=value
|valueformat=%d
|theme=simple
|chartlegend=
|distribution=yes
|distributionsort=asc
|min=10
|labelaxislabel=minimum 10
|height=3000
}}

displays linked labels, as follows
screencapture-fjqplotchart-linkall-error

This is caused by $value = $dataValue->getShortText( $outputMode, $this->getLinker( false ) );

SMW's AggregatablePrinter -> getDistributionResults

getLinker should be forced to return null, since the labels are never clickable in the jqplot format

thomas-topway-it commented 1 year ago

hello @gesinn-it-gea can you also confirm from your side that the statement "labels are never clickable in the jqplot format" is true for all the following chart types "bar", "line", "pie", "donut" ? Also, what about SRFjqPlotSeries ? (this is not affected by the commit since they extend different classes)

gesinn-it-gea commented 1 year ago

In fact, I had only glanced at the pull request. Are the formats mentioned above also affected by your PR?

thomas-topway-it commented 1 year ago

only those handled in the class SRFjqPlotChart

gesinn-it-gea commented 1 year ago

I can not say something about the other chart types. You would have to test this.

thomas-topway-it commented 1 year ago

I have tested, so the error shows only for bar and line, however none of them are clickable. I will check SRFjqPlotSeries later, however this is not affected by the pull request

thomas-topway-it commented 1 year ago

I confirm that SRFjqPlotSeries does not need any update since the linker is already not passed as parameter, see

} elseif ( $object->getDataItem()->getDIType() == SMWDataItem::TYPE_TIME ) {
    $label = $object->getShortWikiText();
} else {
    $label = $object->getWikiValue();
}

SRFjqPlotSeries -> getResultData

this also confirms that it is correct to override the $linker to null in the current pull request for SRFjqPlot