EXPLAINE : Highstock Displaying 1.7 million data points in Highcharts Stock - javascript
Hello everyone i'm a beginner in highstock
i want to work with this to convert my data to graph
then i find some problem in this example of Lazy Loading
i have much question :
need to change this highstock to my data just use a simple data
like this :
[883612800000,3.41,5.01,3.37,4.58],
[886291200000,4.62,5.97,4.34,5.91],
[888710400000,5.89,7.01,5.40,6.88],
[891388800000,6.87,7.41,6.17,6.85],
[893980800000,6.88,7.91,6.42,6.68],
[896659200000,6.61,7.24,6.39,7.16],
[899251200000,7.22,9.54,7.12,8.67],
[901929600000,8.56,10.92,7.75,7.80],
[904608000000,7.84,10.05,7.65,9.52],
[907200000000,9.19,10.33,7.12,9.28],
[909878400000,9.39,9.85,7.94,7.99],
[912470400000,8.00,10.37,7.90,10.23],
[915148800000,10.53,11.82,9.27,10.29],
[917827200000,10.42,10.48,8.63,8.71]`
then in the same example i want a method how to removed the zoom and the scroll in the bottom
and in last
need to sample exampling about this function
function afterSetExtremes(e) {
var chart = $('#container').highcharts();
chart.showLoading('Loading data from server...');
$.getJSON('http://www.highcharts.com/samples/data/from-sql.php?start=' + Math.round(e.min) +
'&end=' + Math.round(e.max) + '&callback=?', function (data) {
chart.series[0].setData(data);
chart.hideLoading();
});
}
** in the end thanks for all and sorry for my bad english any confused ask in commentaire **
You cannot load form filesystem (security reasons in browsers) so you need to have a webserver. Please check our article how to load data and process
Related
javascript d3 render chart
I am trying to learn some chart rendering techniques for front end web development. There is a d3 tutorial where the javascript function can be edited on the website (great for learning purposes) and I am attempting to use my own data instead. In the tutorial website I am attempting to modify the rawgit //Read the data d3.csv("https://raw.githubusercontent.com/holtzy/data_to_viz/master/Example_dataset/3_TwoNumOrdered_comma.csv", with my own rawgit dataset: //Read the data d3.csv("https://raw.githubusercontent.com/bbartling/Data/master/City%20Rec%20Center%202%20kW%202019.csv", One thing to note is my data is hourly and the tutorial data is daily.. So would I need to modify anything with the time parse function? // When reading the csv, I must format variables: function(d){ return { date : d3.timeParse("%Y-%m-%d")(d.date), value : d.value } }, I am trying to follow this learn javascript site that talks about timeParse but not having anyluck... Could anyone give me a tip? Also to mention my dataset the timestamp/index column is Date not date and the data is kW not value... Do I need to modify the tutorial code to accommodate for this as well?
I think I actually figured this out. At least I got the chart to render on the tutorial site... Changing the timeParse function to this: //Read the data d3.csv("https://raw.githubusercontent.com/bbartling/Data/master/City%20Rec%20Center%202%20kW%202019.csv", // When reading the csv, I must format variables: function(d){ return { date : d3.timeParse("%m/%d/%Y %H:%M")(d.Date), value : d.kW } },
Post JSON data in a page, from an URL (dynamic data)
I'm trying to post some mailing campaign statistics in a webpage on a website I'm building with Wordpress. I need the statistics to update on their own as data changes, so instead of parsing a JSON string directly I want to use an URL so the data is continually being fetched from the Mailify (mailing service I'm using) server. I have some Pascal programming experience but I'm new to javascript and I've been struggling a lot with this particular problem. Because I'm getting desperate, I figured I'd try asking for help. I've figured out how to request the data from the URL (although I forgot how I did it last time and rn I'm not able to get past the pop-up that requests the credentials), and also how to post on the page using JS, which would be something basic. But I can't figure out how to fetch the data from JSON in real time. I've seen so many different examples but they're all a little different and not really similar to this situation. Some useful data: API Key: 8RdZ1SkxTeWGlk2T049KOw Account ID: 5c7650c911ce626a6371c1b5 Mailing campaign ID: TZi4oEiSRDCqciu-vGV98A JSON URL: https://mailifyapis.com/v1/reports/TZi4oEiSRDCqciu-vGV98A JSON URL I'm using to try and include the key and ID: https://mailifyapis.com/v1/reports/TZi4oEiSRDCqciu-vGV98A&accountId=5c7650c911ce626a6371c1b5&apiKey=8RdZ1SkxTeWGlk2T049KOw (It's still giving me a pop-up) This is the Mailify documentation page: http://developers.sarbacane.com/#statistiques (have to translate with Google, they have no translation of their own) I've tried understanding how curl works but I have to install some stuff and I thought I could get around the problem without it. Here's what I have tried (I've just been probing the syntax, mostly): <script> <p id="demo"></p> var text = 'https://mailifyapis.com/v1/reports/TZi4oEiSRDCqciu-vGV98A&accountId=%225c7650c911ce626a6371c1b5%22&apiKey=%22w_S31uj2RIGHVENnRbD4xw%22'; var obj = JSON.parse(text); obj.opens = eval("(" + obj.clicks + ")"); document.getElementById("demo").innerHTML = obj.opens + ", " + obj.clicks(); </script> I realize it doesn't work like this but that was my last attempt. I can't figure out what I should be doing.
CRM 2016 - Programmatically filtering subgrid
I am trying to filter this subgrid ShipmentReportsInformation by the end customer field to show only the end customer records of the account that I'm currently viewing. Right now it's showing all of them (can't use the "show only related records" in the form because it's just text). I'm using Microsoft Dynamics 2016 on-premesis. So I made a web resource (onload event) and this is what I have put together so far: function Filter(){ var str = Xrm.Page.getAttribute('name').getValue(); //this contains the correct text //alert(str); var AllRows = Xrm.Page.getControl("ShipmentReportsInformation").getGrid().getRows(); //all rows inserted in AllRows var FilteredRows = AllRows.forEach(function (AllRows, i) { if(Xrm.Page.getAttribute('new_endcustomer').getValue() == str){ FilteredRows.push(AllRows.getData().getEntity().getEntityReference()); } //Now I think I should only have the lines added to the FilteredRows variable that match the if condition }); Xrm.Page.getControl("ShipmentReportsInformation").setData(FilteredRows); //putting the data from the var in the subgrid } I'm pretty new at coding, so please, if I do something ridiculous there, you know. Sadly, it's not working and the log/error report I get isn't any help at all. The error and the form, to illustrate: http://prntscr.com/cwowlf Can anyone help me spot the issues in the code please? I even think it's loading the code before the subgrid is loaded but I don't know how to properly delay it. I tried .getreadystate != complete but it's never complete according to that. Just to help out with what I found so far: here is where I got most of my information from: -https://msdn.microsoft.com/en-us/library/dn932126.aspx#BKMK_GridRowData Kind regards
Although the question is old, I was trying to find a way to filter a subgrid and stumbled upon this post. According to the SDK, this is what is mentioned for the setData method: Web resources have a special query string parameter named data to pass custom data. The getData and setData methods only work for Silverlight web resources added to a form Cheers
Importing data from two csv files using d3js
consider this fiddle link FIDDLE. In this example I would like to use a csv file to load data at line no.33-[data.csv] and data at line no.158-[data1.csv]. I want to use two separate csv files. I tried using a csv file for data at line no.33 with this code d3.csv("data.csv", function(csvData) { csvData.forEach(function (d,i) { data[i] = { first: +d.first, second: +d.second } }); console.log(data); I was able to get an output but the charts had moved far away from each other with the following errors : Unexpected value NaN parsing cy attribute. How to load the two datasets in an efficient way using two separate csv files ?
Here is hopefully the final plunker in this ever-growing project :) (A lot of the csv work here has been guided by the great Lars...as usual, many kudos to him.) Updated plunker with data on top chart coming from datam.csv.
Multiple datasheets in crossfilter + d3.js
I am Newbie to this crossfilter and d3.js..Data for my project is loaded from my project directory,i have csv files for data.When loading single data sheet(single csv file) and giving input to crossfilter its fine,its working well.. But when i have 2 sheets how can i combine into single and give input to crossfilter?? Corresponding code: d3.csv("vc5.csv", function (data) { crossfilter(data); //Doing calculation //All charts calculations and chart display }); But now my requirement is,i have to read data from 2 datasheets(2 csv files) having common field "Name". My requirement: d3.csv("vc5.csv", function (data) { d3.csv("xxx.csv",function(data1){ crossfilter()-------------------------->I have to combine 2 datas into single object and i have to pass to crossfilter. //Doing calculation //All charts calculations and chart display }); }); Help me to achieve this?? Thanks in advance
You can use the add method: https://github.com/square/crossfilter/wiki/API-Reference#wiki-crossfilter_add Step 3 in this answer is what you're looking for https://stackoverflow.com/a/21194072/916734