Is CanvasJS compatible with Excel and making chart? [closed] - canvasjs

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I was wondering if its capable of reading an excel file (ie. sample.xls) and making a chart based on that? If so can you provide a sample image and the source code. thanks

CanvasJS doesn't currently support importing or exporting data in Microsoft Excel format. You’ll have to do the conversion to and from CanvasJS format.
Reference: http://canvasjs.com/docs/charts/basics-of-creating-html5-chart

use below code as reference of exporting data into excel
document.getElementById("downloadExcel").addEventListener("click", function(){
downloadAsExcel({ filename: "chart-data", chart: chart })
});
function downloadAsExcel(args) {
var dataPoints, filename;
filename = args.filename || 'chart-data';
dataPoints = args.chart.data[0].dataPoints;
dataPoints.unshift({x: "X Value", y: "Y-Value"});
var ws = XLSX.utils.json_to_sheet(dataPoints, {skipHeader:true, dateNF: 'YYYYMMDD HH:mm:ss'});
if(!ws['!cols']) ws['!cols'] = [];
ws['!cols'][0] = { wch: 17 };
var wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, filename);
XLSX.writeFile(wb, filename + ".xlsx");
}
reference link https://jsfiddle.net/canvasjs/7kqeprcs/ for exporting data in excel file.
If you want to download Multi series chart data in single excel file then refer https://jsfiddle.net/Root_Savaj/zmf6uqsv/ Link.

Related

Looking for help to use script in Sheets to avoid having equations in multiple sheets [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Using example Test Sheet
Looking to use script in Sheets to;
Read active sheet name [e.g. RED]
Look in SUMMARY Sheet and find matching sheet name in column A and read associated integer [e.g. R1C2]
Multiply that by RED R1C1 and display result in RED R1C2
I would want to be able to do this for all values in column 1 in RED, GREEN & BLUE sheets, either on opening or by using a button
Any pointers would be greatly appreciated!
Your question has been voted down as you haven't shown any research or posted any of your own code. I'll help you out as I too am new here ;-). It is good that you have broken your request down, the next step would have been to start writing code... The following code will do what you have requested, bar it on running on open or by using a button. My advice to getting started with Apps Script would be to read through the reference documents and samples so that you understand fully what the code does.
function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var activeSheet = ss.getActiveSheet();
var activeSheetName = activeSheet.getSheetName();
var activeSheetData = activeSheet.getDataRange().getValues();
var summarySheet = ss.getSheetByName("SUMMARY");
var summarySheetData = summarySheet.getDataRange().getValues();
for (var i = 0; i < summarySheetData.length; i++) {
if (summarySheetData[i][0] == activeSheetName) {
valueToMultiplyBy = summarySheetData[i][1];
}
}
for (var j = 0; j < activeSheetData.length; j++) {
var resultOfMultiplication = valueToMultiplyBy * activeSheetData[j][0];
activeSheet.getRange(j+1,2).setValue(resultOfMultiplication);
}
}

Xamarin, how to constantly display current date and time on a label like a digital clock? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
Most of the tutorials are with datepickers. How do i display current date and time in a label. I've googled and all are about date pickers.
Today is "current date + time" . =Label
if you want a constantly updating time, use a Timer
System.Timers.Timer timer = new System.Timers.Timer(1000);
timer.Elapsed += TimerElapsed;
timer.AutoReset = true;
timer.Start();
private void TimerElapsed(Object source, ElapsedEventArgs e)
{
myLabel.Text = e.SignalTime.ToString();
}
if you want to use databinding, have your elapsed event update the ViewModel property that your label is bound to instead of directly updating the Label
You can do this (assuming you have a view model with a property of type DateTime called MyDate):
<Label Text="{Binding MyDate, StringFormat='Today is {0:MMMM d, yyyy HH:mm}'}" />
Output would be something like this:
Today is July 23, 2019 11:05

How to show more than 1 Stats panel in Three.js, side by side [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Only if it's possible; for example one panel for FPS and another one for MS
Thanks, best regards
Yes, you can have multiple:
var stats1 = new Stats();
stats1.showPanel(0); // Panel 0 = fps
stats1.domElement.style.cssText = 'position:absolute;top:0px;left:0px;';
document.body.appendChild(stats1.domElement);
var stats2 = new Stats();
stats2.showPanel(1); // Panel 1 = ms
stats2.domElement.style.cssText = 'position:absolute;top:0px;left:80px;';
document.body.appendChild(stats2.domElement);
And then in your main loop
stats1.update();
stats2.update();
stats.js r17

Transferring some parts of image [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am trying to transfer some part of my image to another matrix with this code:
p1 = zeros(512,512,3);
p1(1:128, 1:128, 1:3) = image(1:128, 129:256, 1:3);
And when this code did not work I tried with 3 for loop
and after that I tried to transfer R G B layers separately:
p1(1:128, 1:128, 1) = image(1:128, 129:256, 1);
But none of these codes work. Could anyone tell me what to do?
In Matlab you can always assign one matrix to another with the same size. For example:
A = ones (4,2,3,4,5);
B = zeros(4,2,3,4,5);
A = B
will run with no errors.
It is possible that the type of the image you are using is uint8 (8-bit unsigned integer), while zeros creates a double matrix. This will result in improper behavior of operations or built-in functions, if you do not cast (change the type of) your matrices properly. Use whos to check the type of your image:
whos image
Try to cast the zeros to uint8:
p1 = uint8(zeros(512,512,3));
...
Here is an example:
image = imread('peppers.png');
partail_im = uint8(zeros(size(image)));
partail_im(1:128,1:128,:) = image(1:128,129:256,:);
imshow(partail_im);
Note: It's better not to use image as the name of any variable since it's name of a built-in function image.

Combine Thumbnails to One Large Image with RMagick [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
What's the shortest way to combine say 20 256x256 thumbnails into a single large image of 4 rows by 5 columns using RMagick?
Assuming all the images are in the current directory and named from 1.jpg to n.jpg and row * col = n.
include Magick
row = NUM_ROWS
col = NUM_COLS
ilg = ImageList.new
1.upto(col) {|x| il = ImageList.new
1.upto(row) {|y| il.push(Image.read((y + (x-1)*col).to_s + ".jpg").first)}
ilg.push(il.append(false))}
ilg.append(true).write("out.jpg")

Resources