# Using Highgraphs Stock in CakePHP 4

**URL:** <https://discourse.cakephp.org/t/using-highgraphs-stock-in-cakephp-4/8134>\
**Category:** Need Help\
**Created:** [July 28, 2020, 3:48am UTC](https://discourse.cakephp.org/t/using-highgraphs-stock-in-cakephp-4/8134 "2020-07-28T03:48:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hassam91](https://avatars.discourse-cdn.com/v4/letter/h/85e7bf/32.png) [@hassam91](https://discourse.cakephp.org/u/hassam91)\
**Post date:** [July 28, 2020, 3:48am UTC](https://discourse.cakephp.org/t/using-highgraphs-stock-in-cakephp-4/8134/1 "2020-07-28T03:48:08Z")

</div>

Greetings everyone!

I am new to PHP development and need to use highgraphs stock in my cake PHP based webpage. I am able to use the simple high graph chart but the stock chart is not working. Any help or guidance in this regard will be highly appreciated.  
Thanks

---

<div class="post-metadata">

**Author:** ![bizdev](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/bizdev/32/1951_2.png) [@bizdev](https://discourse.cakephp.org/u/bizdev)\
**Post date:** [July 28, 2020, 5:18am UTC](https://discourse.cakephp.org/t/using-highgraphs-stock-in-cakephp-4/8134/2 "2020-07-28T05:18:40Z")

</div>

Hi @hassam91,

Please share some code or let us know what issues you facing along with implementation steps you are doing.

---

<div class="post-metadata">

**Author:** ![hassam91](https://avatars.discourse-cdn.com/v4/letter/h/85e7bf/32.png) [@hassam91](https://discourse.cakephp.org/u/hassam91)\
**Post date:** [July 28, 2020, 5:57am UTC](https://discourse.cakephp.org/t/using-highgraphs-stock-in-cakephp-4/8134/3 "2020-07-28T05:57:44Z")

</div>

Hello, Kindly find the codes below:

In ArticlesController.php

> ```
> $stockChart = new Highchart(Highchart::HIGHSTOCK);
> $stockChart->series[] = array('name' => 'Tokyo', 'data' => array(7.0, 6.9, 9.5), 'renderTo' => 'container');
> $this->set( compact( 'chart' ) );
> 
> ```

In index.php  
`

> \< div id=“container” style=“height: 400px; min-width: 310px”\>  
> \<?php $stockChart-\>printScripts(); ?\>
> 
> ```
> <script type="text/javascript">
> <?php echo $stockChart->render("chart");?>
> </script>
> 
> ```

---

<div class="post-metadata">

**Author:** ![hassam91](https://avatars.discourse-cdn.com/v4/letter/h/85e7bf/32.png) [@hassam91](https://discourse.cakephp.org/u/hassam91)\
**Post date:** [July 28, 2020, 6:47am UTC](https://discourse.cakephp.org/t/using-highgraphs-stock-in-cakephp-4/8134/4 "2020-07-28T06:47:12Z")

</div>

I was able to resolve it. By using $stockChart-\>chart instead of $stockChart-\>stockChart
