Revisão | 52 (tree) |
---|---|
Hora | 2009-10-08 22:20:28 |
Autor | hirohitohigashi |
javascript event handler をサポート
@@ -61,6 +61,9 @@ | ||
61 | 61 | { |
62 | 62 | $s = ""; |
63 | 63 | |
64 | + // id | |
65 | + if( isset( $attr['Id'] ) ) $s .= 'id="'. $attr['Id']. '" '; | |
66 | + | |
64 | 67 | // area rectangle. |
65 | 68 | if( isset( $attr['X'] ) ) $s .= 'x="'. $attr['X']. '" '; |
66 | 69 | if( isset( $attr['Y'] ) ) $s .= 'y="'. $attr['Y']. '" '; |
@@ -85,6 +88,13 @@ | ||
85 | 88 | if( isset( $attr['Opacity'] ) ) $s .= 'opacity="'. $attr['Opacity']. '" '; |
86 | 89 | if( isset( $attr['StrokeOpacity'] ) ) $s .= 'stroke-opacity="'. $attr['StrokeOpacity']. '" '; |
87 | 90 | |
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 | + | |
88 | 98 | return $s; |
89 | 99 | } |
90 | 100 |
@@ -50,11 +50,14 @@ | ||
50 | 50 | * |
51 | 51 | *@param ydata データの配列 |
52 | 52 | *@param labels ラベルの配列 |
53 | + *@retval データコンテナ配列 | |
53 | 54 | */ |
54 | 55 | function addData( array $ydata, array $labels ) |
55 | 56 | { |
56 | 57 | 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 | + ); | |
58 | 61 | } |
59 | 62 | |
60 | 63 | if( ! $this->AtLegend ) { |
@@ -123,7 +126,7 @@ | ||
123 | 126 | } |
124 | 127 | |
125 | 128 | $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", | |
127 | 130 | $x1,$y1, $r,$r, $l_arc, $x2,$y2, |
128 | 131 | $cx,$cy, |
129 | 132 | $this->make_common_attribute_string( $this->DataSeries[$i]->AtPiece ) ); |