Skip to content

Commit 46650d0

Browse files
authored
Update README.md
1 parent 32ae4ae commit 46650d0

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,27 @@ Example:
146146
Whith this simple code you will generate the most simplest graph:
147147

148148
![Simple graph bar](https://github.com/vivesweb/graph-php/blob/main/samplesimple.png?raw=true)
149+
150+
Example with x & y values:
151+
152+
$graph = new graph();
153+
$graph->bar( [10, 20, 30, 40], [1, 4, 9, 16] );
154+
$graph->title("With X & Y Values"); // Set the title of the bar. See title() method
155+
echo '<img src="'.$graph->output_gd_png_base64( ).'" >'; // Echo img raw data in html page
156+
157+
Whith this simple code you will generate the most simplest graph:
158+
159+
![Simple graph bar with X & Y values](https://github.com/vivesweb/graph-php/blob/main/samplexyvalues.png?raw=true)
160+
161+
149162

150163
- **SET GRAPH TITLE:**
151164

152165
*$graph->title( $title );*
153166

154167
*$graph->set_title( $title ); // synonymous of title()*
155168

156-
This method set the graph title
169+
This method set the graph TITLE
157170

158171
$title: String with the title
159172

@@ -167,6 +180,30 @@ Example:
167180
Whith this simple code you will generate Simple Bar graph with title:
168181

169182
![Simple graph bar with title](https://github.com/vivesweb/graph-php/blob/main/sampletitle.png?raw=true)
183+
184+
- **SET GRAPH Y LABEL:**
185+
186+
*$graph->ylabel( $ylabel );*
187+
188+
*$graph->set_ylabel( $ylabel ); // synonymous of ylabel()*
189+
190+
This method set the graph Y LABEL
191+
192+
$ylabel: String with the Y LABEL
193+
194+
Example:
195+
196+
$graph = new graph();
197+
$graph->bar( [1, 2, 3, 4] );
198+
$graph->ylabel( 'Here your graph Y LABEL' );
199+
echo '<img src="'.$graph->output_gd_png_base64( ).'" >'; // Echo img raw data in html page
200+
201+
Whith this simple code you will generate Simple Bar graph with Y label:
202+
203+
![Simple graph bar with Y LABEL](https://github.com/vivesweb/graph-php/blob/main/sampleylabel.png?raw=true)
204+
205+
206+
170207

171208

172209

0 commit comments

Comments
 (0)