I ran the highcharts demo app and it runs fine.
I created a variable called chartOptions in app.component.ts. This variable holds the json which I got from the highcharts cloud.
When I bind this variable to options in Highcharts, the chart is not rendering. There are no errors in the console as well. I am able to render chart using javascript ( $('#wind-rose').highcharts(json from the above link) )
Am I missing something?
Related
I am working on a multiple series line chart in ruby on rails. I have passed to the chart data as such:
<%= line_chart #budget.transactions.group(:category).group(:date).sum(:amount) %>
In the developer tools I looked at the script that populates the chart and it looks like:
new Chartkick.LineChart("chart-2", [{"name":"debt","data":[["2017-04-19",5.43],["2017-04-20",60.0]]},
{"name":"entertainment","data":[["2017-04-19",30.0]]},
{"name":"food","data":[["2017-04-20",15.0],["2017-04-21",20.0]]},
{"name":"housing","data":[["2017-04-02",17.33],["2017-04-10",20.0],["2017-05-01",522.0]]},
{"name":"transportation","data":[["2017-04-20",50.0]]},
{"name":"utilities","data":[["2017-04-19",35.0],["2017-04-21",20.0],["2017-04-27",77.34]]}], {});
To me the format for the data being passed to the chart seems correct, but the output... not so much. Also I was thinking using the Ruby Date class, rather than DateTime was causing a problem but I'm not sure. Any help appreciated.
enter image description here
I am using ASP.NET MVC with Kendo UI. I want to export grid to an HTML page and print it. Online help is not available. What have your done previously. Thanks in advance.
Did you find a solution to this? I'm looking at the same thing currently and have found a couple of options:
Firstly Telerik have a Javascript example which renders your grid to a new print window, see https://docs.telerik.com/kendo-ui/controls/data-management/grid/print-export
Just alter the name of
var gridElement = $('#grid'),
to your own existing grid name and omit the function:
$(function () {
var grid = $('#grid').kendoGrid({
...
};
};
However, this only renders what is currently displayed on screen (so if your grid has multi pages it may not be suitable).
The second option that I'm exploring is exporting to pdf (and then user can then print that if they wish). There are example of this at
https://demos.telerik.com/aspnet-mvc/grid/pdf-export and https://docs.telerik.com/kendo-ui/controls/data-management/grid/pdf-export
This does have multi-page printing support (although I haven't got it to work just yet, they have examples which show it working). They do mention potential problems if you have a lot of data as it needs to load all the data on the client side (even if you have paging). There are some example projects to work on data server side in the above links.
In the end our requirements didn't need the paging but I've gone with the pdf option as that delivers quite a nice layout that you can template further.
I am using highcharts to create charts on my site, it works fine. how i display "loading" message until the chart loading on my page. data loaded dynamically from rails array object not a url.
You haven't specified loading option in your highchart configuration. To use showloading() you do need to have this configuration defined. It uses some default time duration to show loading screen. here a complete option url http://api.highcharts.com/highcharts#loading.hideDuration that might help you.
Has anyone successfully integrated HighCharts with FullCalendar?
Currently I display data in a monthly view using text. I would like to replace them with pie charts generated by the HighCharts js library.
The FullCalendar uses a EventSource to load the events. I send JSON serialized data from my MVC controller. To enable HTML in the Event Title I use the solution mentioned here
I tried using the DotNet.HighCharts library and returning the chart.ToHtmlString() as the event title, but I keep getting the js error below:
Unhandled exception at line 117, column 483 in
/Scripts/Highcharts-2.3.5/js/highcharts.js
0x800a138f - JavaScript runtime error:
Unable to get property 'length' of undefined or null reference
I got this to work. The problem was with the DotNet.HighCharts library. The chart script that is was returning (chart.ToHtmlString()) had issues with the latest version of the HighCharts JS scripts. Instead I removed the DotNet.HighCharts library and constructed the Chart JS script in my controller and it works fine.
I need to get the DOM string of a template. However, a highCharts chart is added to the template after it is loaded. When I use g.render, I do not get the chart in the resultant string. Basically, the javascript doesn't run. Can anyone help?
If some kind of javascript has to run on the client, before the server is doing something else, you have to use ajax to make a callback from the client. See the grails ajax docs for code examples.