Support the ongoing development of Laravel.io →
Database Views Mail
Last updated 2 years ago.
0

If you want simple graphs I think ChartJS one is the easiest to use, and they look very good as well! http://www.chartjs.org/

Last updated 2 years ago.
0

Thanks for the reply.

Yes, I did take a look at ChartJS, xCharts, MorrisJS and a few others that are very nice and render client-side.

Like I mentioned previously, the other requirement is to generate them on the server and render them as images so I can use them in the application UI as well as embed them in emails.

Last updated 2 years ago.
0

I think you need to set up some custom rendering for this. ChartJS uses a canvas element, which you can render using javascript:

var imageData = canvas.toDataURL('image/png');

You can then post this data to your server using AJAX, it will just return a base64 encoded PNG. More on this here: http://motyar.blogspot.nl/2010/04/save-html5-canvas-data-as-image.html

Hope that helps you further!

Last updated 2 years ago.
0

Thanks for further details, though I am not sure if that's the best solution to the problem.

What would be nice is to have the graph rendered on the server because,

  1. utilize processing power of the server
  2. charts may have to be only emailed (users don't have to see it online
  3. hundreds of data points is used to generate the charts that increases network traffic

Please correct me if I am wrong in understanding your suggestion.

Also, I see a couple of charting libraries (may be there are more) that do render on the server side

  1. JpGraph
  2. pChart

Can someone who has experience with these (or other libraries) kindly share...thanks.

Last updated 2 years ago.
0
Last updated 2 years ago.
0

Thanks for your response.

But, I believe, this again is client-side (javascript-based).

Last updated 2 years ago.
0

After trying a few of the libraries, I am getting ready to use pChart as the way for creating charts on the server.

I have placed the 3 class files under app/libraries and included the folder in composer.json. But when I run it, I get an error saying "imageftbbox(): Could not find/open font".

Assuming that the pChart library could not access the font files, where should I place the font files that come with the pChart component?

Thanks

Last updated 2 years ago.
0

My preferred way of integrating charts is by using HighCharts (http://www.highcharts.com). They have a lot of options and very easy to use. These charts can be downloaded in png/ jpg formats.

I have used HighCharts with Laravel and they have worked amazingly well for me.

Last updated 2 years ago.
0

Thanks for the suggestion.

Yes, HighCharts is definitely better; but the licensing cost is currently too steep for my client, so exploring pChart.

Last updated 2 years ago.
0

I have finally found a resolution (using pCharts) to this issue and graphs in laravel are being piloted right now with users.

Thanks for all the responses.

Last updated 2 years ago.
0

Just out of curiosity what was your solution. I'm getting the same error.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

asmaakam asmaakam Joined 27 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.