I was trying to follow this demo https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/data/livedata-rows
But can not understand why the date/time is not showing up correctly for me I have it in the exact same format and only changed the link in this example to a local host where I am serving my json file this is what my json looks like
{
"vtg": [
["2021-06-18T16:46:38.981Z", 7.131307519877803],
["2021-06-18T16:46:39.981Z", 6.728442167327733],
["2021-06-18T16:46:40.981Z", 1.272020585570508],
["2021-06-18T16:46:41.981Z", 6.80643850015173],
["2021-06-18T16:46:42.981Z", 3.493474821467808],
["2021-06-18T16:46:43.981Z", 2.1728923419279234],
["2021-06-18T16:46:44.981Z", 8.33079253512965],
["2021-06-18T16:46:45.981Z", 6.068523773578017],
["2021-06-18T16:46:46.981Z", 5.704502768230142],
["2021-06-18T16:46:47.981Z", 1.6336430526049028]
],}
In the example it has the time on the bottom axis and when you hover it gives the full date and time but when I try it with mine the bottom axis becomes 0-10 and the tool-tip shows the exact string. To check I even followed the link in the example that it was pulling data from to make sure the time was formatted correctly but I cant seem to find what I did wrong.
In the documentation you can find that the data should be structured as a row array:
A URL to a remote JSON dataset, structured as a row array. Will be fetched when the chart is created using Ajax.
API: https://api.highcharts.com/highcharts/data.rowsURL
Meanwhile, your data structure is an object: https://jsfiddle.net/BlackLabel/80btkhgx/
series: [{
data: data['vtg']
}]
I've been using highcharts 7.2.0 tilemap chart, but after updating to version 8.2.0, I'm getting an error when tileShape is set to "square"
In my https://jsfiddle.net/nqxm2yk7/1/ , tileShape is set to 'circle', but if you change it to "square", it will be crash.
Although the official documentation says, that we can use four different types of shapes
Is anyone has the same problem?
[1]: https://jsfiddle.net/nqxm2yk7/1/
If you want square tiles you will need to set the chart type to "heatmap":
chart: {
type: 'heatmap',
height: '120%'
},
and also include heatmap.js
Fiddle
I found that it is a regression and I reported it on the Highcharts Github issue channel where you can follow this thread: https://github.com/highcharts/highcharts/issues/14267. If you need a temporary workaround please ask in the comment for it - the core developers will take care of your case.
How do I include plugins for use with the highcharts-export-server? I am trying to use the highcharts-regression plugin.
I tried to use the -resources option to specify the plugin's JS file (both as a local file and as a full URL) file but no regression lines are added to my charts, unlike my browser based version which has the regression lines added.
My command is:
highcharts-export-server
-resources: {"files":"https://github.com/streamlinesocial/highcharts-regression/blob/master/highcharts-regression.js"}
-instr '{"chart":{"type":"line"},"title":{"text":"Total Downtime"},"xAxis":{"type":"datetime","dateTimeLabelFormats":{ day: "%b %Y"}},"yAxis":{"allowDecimals":false,"min":0,"tickInterval":1,"title":{"text":"Percentage"}},"series":[{"name":"BOILER 04/WATERWALL","color":"#2f7ed8","regression":true,"regressionSettings":{"name":"BOILER 04/WATERWALL trend","type":"linear","dashStyle":"dash","color":"#2f7ed8"},"data":[{"x":1451599200000,"y":0,"viewType":"M"},{"x":1454277600000,"y":0,"viewType":"M"},{"x":1456783200000,"y":0,"viewType":"M"},{"x":1459461600000,"y":0,"viewType":"M"},{"x":1462053600000,"y":0,"viewType":"M"},{"x":1464732000000,"y":4.97,"viewType":"M"},{"x":1467324000000,"y":4.89,"viewType":"M"},{"x":1470002400000,"y":0,"viewType":"M"},{"x":1472680800000,"y":0,"viewType":"M"},{"x":1475272800000,"y":0,"viewType":"M"},{"x":1477951200000,"y":0,"viewType":"M"},{"x":1480543200000,"y":0,"viewType":"M"},{"x":1483221600000,"y":0,"viewType":"M"},{"x":1485900000000,"y":0,"viewType":"M"},{"x":1488319200000,"y":0,"viewType":"M"},{"x":1490997600000,"y":0,"viewType":"M"},{"x":1493589600000,"y":0,"viewType":"M"},{"x":1496268000000,"y":0,"viewType":"M"},{"x":1498860000000,"y":0,"viewType":"M"}]}]}'
-outfile sample.png
The chart is generated fine but without the regression plugin features added. The same sort of code works fine when generating the chart in the browser, not using the export-server. Thanks!
This works with a few minor "type-o" fixes. Given the above command you've provided, I've changed -resources: {...} to --resources '{...}', as well as -instr to --instr and -outfile to --outfile, as per the documentation. Although, I think only the colon as well as the quoting are the relevant changes:
highcharts-export-server
--resources '{"files":"highcharts-regression.js"}'
--instr '{"chart":{"type":"line"},"title":{"text":"Total Downtime"},"xAxis":{"type":"datetime","dateTimeLabelFormats":{ day: "%b %Y"}},"yAxis":{"allowDecimals":false,"min":0,"tickInterval":1,"title":{"text":"Percentage"}},"series":[{"name":"BOILER 04/WATERWALL","color":"#2f7ed8","regression":true,"regressionSettings":{"name":"BOILER 04/WATERWALL trend","type":"linear","dashStyle":"dash","color":"#2f7ed8"},"data":[{"x":1451599200000,"y":0,"viewType":"M"},{"x":1454277600000,"y":0,"viewType":"M"},{"x":1456783200000,"y":0,"viewType":"M"},{"x":1459461600000,"y":0,"viewType":"M"},{"x":1462053600000,"y":0,"viewType":"M"},{"x":1464732000000,"y":4.97,"viewType":"M"},{"x":1467324000000,"y":4.89,"viewType":"M"},{"x":1470002400000,"y":0,"viewType":"M"},{"x":1472680800000,"y":0,"viewType":"M"},{"x":1475272800000,"y":0,"viewType":"M"},{"x":1477951200000,"y":0,"viewType":"M"},{"x":1480543200000,"y":0,"viewType":"M"},{"x":1483221600000,"y":0,"viewType":"M"},{"x":1485900000000,"y":0,"viewType":"M"},{"x":1488319200000,"y":0,"viewType":"M"},{"x":1490997600000,"y":0,"viewType":"M"},{"x":1493589600000,"y":0,"viewType":"M"},{"x":1496268000000,"y":0,"viewType":"M"},{"x":1498860000000,"y":0,"viewType":"M"}]}]}'
--outfile sample.png
This successfully gives me the following result with Highcharts export server 2.0.24:
Also, if attempting to use an URL you should probably point to the raw file, but I didn't have any success doing so, so I used a local version of the highcharts-regression.js file.
I'm using highcharts-convert.js with phantomjs, and I'm having some text-overlapping issues when exporting the charts.
I believe the reason is Chrome on OSX renders fonts differently than my ubuntu server does. So when the client's browser builds the SVG the text does not overlap (I have indeed confirmed this by capturing the POST and rendering the svg in Chrome), but when phantomjs renders the text on ubuntu its slightly wider so there is overlap.
I believe that if I export the options JSON rather than SVG, ubuntu will lay out the text according to its own font rendering, and nothing will overlap.
Does that make sense? If so, how can I get highcharts to POST the options JSON rather than SVG?
I have this process that I can use to rig everything up, but it feels like there should be a better way...
var chart = graphContainer.find(".graph-body div").highcharts();
var chartOptions = chart.options;
delete chartOptions.chart["renderTo"]; // this creates a circular reference
// provide extra options to override the chart's defaults here...
$.extend(chartOptions.chart, {backgroundColor: "#FFFFFF", spacingLeft: 30, spacingRight: 30});
// wrap this up and POST it to the server...
console.log(JSON.stringify(chartOptions));
I am trying to export JqGrid to excel so i follow this instruction and i use it like at below.
var grid = new JqGridModelParticipiant().JqGridParticipiant;
var query = db.ReservationSet.Select(r => new
{
r.Id,
Name = r.Doctor.Name,
Identity = r.Doctor.Identity,
Title = r.Doctor.Title.Name,
Total = r.TotalTL,
Organization = r.Organization.Name
});
grid.ExportToExcel(query,"file.xls");
And i get below exception on the line of " grid.ExportToExcel(query,"file.xls");"
Data binding directly to a store query (DbSet, DbQuery, DbSqlQuery) is
not supported. Instead populate a DbSet with data, for example by
calling Load on the DbSet, and then bind to local data. For WPF bind
to DbSet.Local. For WinForms bind to DbSet.Local.ToBindingList().
As far as i understand that it expect to have ObservableCollection that is on DbSet.Local member. But i am working on projected query so i can't do that.
What is the solution for this problem.
In the answer I posted the demo which shows how to implement export to Excel (real *.XLSX file instead of HTML fragment renamed to *.XLS used here).
The method used for exported to the Excel in jqSuite (the demo) produce HTML fragment like
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/excel; charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNetMvc-Version: 2.0
content-disposition: attachment; filename=grid.xls
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Fri, 29 Jun 2012 14:24:54 GMT
Connection: close
<table cellspacing="0" rules="all" border="1" id="_exportGrid" style="border-collapse:collapse;">
<tr>
<td>OrderID</td><td>CustomerID</td><td>OrderDate</td><td>Freight</td><td>ShipName</td>
</tr><tr>
<td>10248</td><td>VINET</td><td>1996/07/04</td><td>32.3800</td><td>Vins et alcools Chevalier</td>
</tr><tr>
<td>10249</td><td>TOMSP</td><td>1996/07/05</td><td>11.6100</td><td>Toms Spezialitäten</td>
</tr><tr>
<td>10250</td><td>HANAR</td><td>1996/07/08</td><td>65.8300</td><td>Hanari Carnes</td>
</tr><tr>
...
</table>
instead of creating of real Excel file. The way is very unsafe because at the opening the "Standard" type of data will be always used. For example if you would export the data like
<td>10249</td><td>TOMSP</td><td>1996/07/05</td><td>11.02.12</td><td>Toms Spezialitäten</td>
the text "11.02.12" will be automatically converted to the date 11.02.2012 if German locale are used as default:
The name "Toms Spezialitäten" from will be wrong displayed as "Toms Spezialitäten".
It can be especially dangerous in case of large table where some small part of data in the middle of grid will be wrong converted. In one project I displayed information about Software and some software versions will be wrong converted to the Date type.
Because of such and other close problems I create real Excel file on the server using Open XML SDK 2.5 or Open XML SDK 2.0. In the way one have no problems described above. So I recommend you to follow the approach described in my old answer.