Index: trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotPie.php |
— | — | @@ -119,21 +119,27 @@ |
120 | 120 | while ( $row = $res->getNext() ) { |
121 | 121 | $name = efSRFGetNextDV( $row[0] )->getShortWikiText(); |
122 | 122 | $name = str_replace( "'", "\'", $name ); |
| 123 | + |
123 | 124 | foreach ( $row as $field ) { |
124 | 125 | while ( ( $object = efSRFGetNextDV( $field ) ) !== false ) { |
125 | 126 | if ( $object->isNumeric() ) { // use numeric sortkey |
126 | | - if ( method_exists( $object, 'getValueKey' ) ) { |
| 127 | + |
| 128 | + // getDataItem was introduced in SMW 1.6, getValueKey was deprecated in the same version. |
| 129 | + if ( method_exists( $object, 'getDataItem' ) ) { |
| 130 | + $nr = $object->getDataItem()->getSortKey(); |
| 131 | + } else { |
127 | 132 | $nr = $object->getValueKey(); |
128 | | - } else { |
129 | | - $nr = $object->getNumericValue(); |
130 | 133 | } |
| 134 | + |
131 | 135 | $pie_data[] .= "['$name', $nr]"; |
132 | 136 | } |
133 | 137 | } |
134 | 138 | } |
135 | 139 | } |
| 140 | + |
136 | 141 | $pie_data_str = "[[" . implode( ', ', $pie_data ) . "]]"; |
137 | 142 | $pieID = 'pie' . self::$m_piechartnum; |
| 143 | + |
138 | 144 | self::$m_piechartnum++; |
139 | 145 | |
140 | 146 | $js_pie =<<<END |