• R/O
  • SSH
  • HTTPS

psgraph: コミット


コミットメタ情報

リビジョン52 (tree)
日時2009-10-08 22:20:28
作者hirohitohigashi

ログメッセージ

javascript event handler をサポート

変更サマリ

差分

--- trunk/psgraph_base.php (revision 51)
+++ trunk/psgraph_base.php (revision 52)
@@ -61,6 +61,9 @@
6161 {
6262 $s = "";
6363
64+ // id
65+ if( isset( $attr['Id'] ) ) $s .= 'id="'. $attr['Id']. '" ';
66+
6467 // area rectangle.
6568 if( isset( $attr['X'] ) ) $s .= 'x="'. $attr['X']. '" ';
6669 if( isset( $attr['Y'] ) ) $s .= 'y="'. $attr['Y']. '" ';
@@ -85,6 +88,13 @@
8588 if( isset( $attr['Opacity'] ) ) $s .= 'opacity="'. $attr['Opacity']. '" ';
8689 if( isset( $attr['StrokeOpacity'] ) ) $s .= 'stroke-opacity="'. $attr['StrokeOpacity']. '" ';
8790
91+ // event handler
92+ if( isset( $attr['OnClick'] ) ) $s .= 'onclick="'. $attr['OnClick']. '" ';
93+ if( isset( $attr['OnMouseOver'] ) ) $s .= 'onmouseover="'. $attr['OnMouseOver']. '" ';
94+ if( isset( $attr['OnMouseOut'] ) ) $s .= 'onmouseout="'. $attr['OnMouseOut']. '" ';
95+ if( isset( $attr['OnMouseDown'] ) ) $s .= 'onmousedown="'. $attr['OnMouseDown']. '" ';
96+ if( isset( $attr['OnMouseUp'] ) ) $s .= 'onmouseup="'. $attr['OnMouseUp']. '" ';
97+
8898 return $s;
8999 }
90100
--- trunk/psgraph_pie.php (revision 51)
+++ trunk/psgraph_pie.php (revision 52)
@@ -50,11 +50,14 @@
5050 *
5151 *@param ydata データの配列
5252 *@param labels ラベルの配列
53+ *@retval データコンテナ配列
5354 */
5455 function addData( array $ydata, array $labels )
5556 {
5657 for( $i = 0; $i < count( $ydata ); $i++ ) {
57- $this->DataSeries[] = new PSGraph_container_pie( $ydata[$i], $labels[$i], self::$COLORLIST[$i % count(self::$COLORLIST)] );
58+ $this->add_data_series(
59+ new PSGraph_container_pie( $ydata[$i], $labels[$i], self::$COLORLIST[$i % count(self::$COLORLIST)] )
60+ );
5861 }
5962
6063 if( ! $this->AtLegend ) {
@@ -123,7 +126,7 @@
123126 }
124127
125128 $this->Output->printf( '<path d="M0,0 L%d,%d A%d,%d 0 %d,1 %d,%d Z" transform="translate(%d,%d)" %s title="'.
126- $this->DataSeries[$i]->DataValue. "\"/>\n",
129+ $this->DataSeries[$i]->DataValue. "\" />\n",
127130 $x1,$y1, $r,$r, $l_arc, $x2,$y2,
128131 $cx,$cy,
129132 $this->make_common_attribute_string( $this->DataSeries[$i]->AtPiece ) );
旧リポジトリブラウザで表示