score:0
i had same issues, but after profiling my laravel application, i found that the issue is not highcharts but my queries to database were not optimzied, so i optimezed by avoiding to use eloquent relationship or eager loading for heavy tables, you can also consider to use temporary tables,below is a sample of raw query in laravel.
public function countoutstanding()
{
$count= db::select("select count(1) as count from mytable");
return array_shift($count)->count;
}
score:6
this is actually not a laravel issue. before i get into the slow load times, if you want to return a script, you need to set the correct headers.
this:
return view('highchart.gauge')->with(compact('value' , 'divname','charttitle','suffix','minvalue','maxvalue','colormin','colormed','colormax'));
should be this:
return response(view('highchart.gauge')->with(compact('value' , 'divname','charttitle','suffix','minvalue','maxvalue','colormin','colormed','colormax')), 200, ['content-type' => 'application/javascript']);
now to answer the slow load times, you are loading...12 scripts or so? in order to minimize load times, you should minimize the number of roundtrips / have fewer http requests. each browser has a max number of simultaneous http connections per server, which is what your image is illustrating. it's simultaneously loading 2 (or so?) scripts at a time.
in addition to this, you are using laravel to parse your scripts rather than just simply serving a javascript file. that's a lot of overhead. so what do you need to do?
- minimize http requests.
- if possible, just serve a file rather than having the server parse the script.
one way to minimize http requests is to send all the variables at once and then return the concatenated view. in order to concatenate views, you can just use the period like you would with strings:
return response(view(...) . view(...), 200, ['content-type' => 'application/javascript']);
another way, which i would recommend, would be to move your highchart script to your public directory. then, in your blade file, just store the variables in a javascript array. your highchart script can then loop through that and initialize the chart(s).
Source: stackoverflow.com
Related Query
- php: laravel slow view render time when rendering javascript for highcharts
- Simple, Open source PHP wrapper for Highcharts library
- PHP in Javascript for PhantomJS + Highcharts
- Error: Data source must be a URL for refresh | console error | javascript | Highcharts
- How to render partial view for HighCharts and pass parameter in MVC?
- How to get Render Performance for Javascript based Charting Libraries?
- Javascript Highcharts v3.0.5 - How to hide Y Axis Title when using multiple Y Axis
- JavaScript error when using Highcharts
- Rails - convert date string into javascript date object for highcharts
- Highcharts too slow when plotting 4000 bars (rCharts)
- Labels are not rendering for plotLines highcharts
- Highcharts Line - When Y axis min is set to 0, connecting line isn't shown for consecutive 0 values
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- HighCharts is slow to load data when building multiple charts
- when printing page with highcharts using javascript this.print() width values in css in @media print seem to be ignored
- Date / Time problem in javascript with highcharts
- Highcharts slow performance when adding more than 10 series
- How to remove outer shadow when hovered from highcharts JAVASCRIPT
- How to display line break for irregular time series with highcharts
- passing formatting JavaScript code to HighCharts with JSON
- How to do a if else statement for highcharts in laravel
- Get javascript highcharts to render inside a Bootstrap Popover
- Highcharts not working when pass the javascript variable as hightcharts series data
- Highcharts display label for pie chart using html table as data source
- How to specify specific tick positions for highcharts when loading dynamic data?
- Javascript not working when using async attribute : Highcharts
- Why doesn't HighCharts render when I pull it in with Ajax?
- Multidimensional JSON to javascript array for highcharts
- Php 2D array into javascript array in highcharts
- How to make hover effect for two bar in highcharts at the same time is there any way by using css or any inbuilt method to achieve this?
More Query from same tag
- How to setExtremes in xAxis event handler?
- Input field in highcharts graphic
- Highcharts GANTT Chart Tooltip Mouse-over Tracking Issue
- Highcharts Network Graph (Forced Directed Graph) in ReactJs
- Highscore with jQuery.ajax: How to Initialize / Scope Issue
- Legends not matching columns ticks on xAxis in Highcharts
- HighChart on Android dynamically update
- using dynamic data from highcharts in a html table
- How to change camera angle in highcharts 3d
- highcharts crosshairs wont work
- How to remove name from legend in Highmaps
- Average values based on date from json to array of arrays
- Left-align y-axis title with labels in Highcharts
- How to create vertical merged stacked bar in highchart
- Change color of series onclick events across multiple highcharts
- Highcharts data labels overlapping columns
- timestamp values showing wrong on xaxis in highcharts its show default 1970-01-18
- HTML Content to Javascript Code
- how to show data for single day in graph using php mysql
- Show all labels in highcharts horizontal bar graph
- Highcharts Stacked Columns Labels on Top
- How to bind dynamic data in highcharts Tooltip
- HIghcharts.js add catgories with addseries on column chart
- HighCharts: render the xAise line as the yAise line
- Highcharts prevent page on mobile Safari from moving up and down as I scroll horizontally through data points
- Highstock - display number of week
- Highchart event LOAD is not working
- Reactive charts with Meteor : d3charts , Hightcharts , ChartJS , other?
- Highcharts - Dyanmic graph with no initial data
- Show PlotLine value on yAxis Highcharts