pChart with yii2

I managed to integrate pChart with yii2 but when yii has to generate picture of the chart it shows what is in picture 1 instead on picture 2.

What is the solution for this.

Looks like you need to set an appropriate http header so the browser knows its an image.

fyi, the highcharts miloschumann extension is super easy to use, i recommend it.

"miloschuman/yii2-highcharts-widget": "*"

[SOLVED] I had to create controller that generates chart and in another controller just call that first one and display image


<img src="/statistics/pigeons" />

Hi Timmy,

Hope you’re well.

I know this is an old thread but if possible can you please share some of your findings either here for everyone or privately (don’t know if that’s possible).

The reason I started looking into pChart is because I need to generate some server side charts (basic ones) to be able to produce a PDF with some charts and return it as a file. In other words I need a “web callable” functionality to produce the PDF without using a browser. The other option I am thinking of is the headless browser approach but again I don’t have much experience in any of these.

I started the below thread recently but haven’t received any response or feedback yet then I found your old thread, so I’m trying to reach you through this thread.

Thank you.