Creating more than one array for dataset [closed] - javascript

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
Consider the example shown in the link Labeling the axis with alphanumeric characters. How to create multiple arrays for the var data ? i.e. two separate for the lines [2,2],[3,3],[4,4],[5, 4],[5.5, 5] and [6, 6],[6, 7],[6.5,8],[6.5,16],[17, 16] ?

If I understand you, I think at this point, you want to start factoring out your code. So, building on this EXAMPLE I have built for you before (inside my comment), here is an UPDATED FIDDLE with both lines. You can factor out the code some more, but this should get you going.
// begin of drawing dots
drawDots(data);
drawDots(data2);
// end of drawing dots

Related

Math.sin() behaving strangely in javascript [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 last year.
Improve this question
For some reason when I input Math.PI and 3.14 I get completely different and even impossible results
Edit: Nevermind, I'm just dumb and didn't notice the e-16
It gives ~10^-16 something very close to zero you can
console.log(Math.sin(Math.PI).toFixed(2))
Here I have set up a test of your problem
console.log(Math.sin(3.14));
console.log(Math.sin(Math.PI));
When run, I get this result:
0.0015926529164868282
1.2246467991473532e-16
The 2nd number is a really really small positive number. It is essentially 0. The first number is slightly larger, but 3.14 is a rounded value of PI, and that's why you get the difference

Detect colored dots in image with tracking js [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 4 years ago.
Improve this question
I am trying to make a program to count the dots on all the dominoes in a picture, like this:
I want it to be a JavaScript function. I have tried to understand how to use tracking js with tutorials, but they're all abput face recognition. I only want it to detect colored dots and output how many of them are present in a picture. Is that possible in any way? Thanks for any help!
Yes you can by using some image recognition such as https://trackingjs.com/ or other.

Jquery comma separated array in one line to comma separeted array on multiple lines [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 4 years ago.
Improve this question
I do have an array inside Jquery(red array) on one line.
I do want it like the blue array seperated on multiple lines.
The red array needs to be like the blue array on the image.
Can some tell me how to do that, tried a lot of thing.
Try this:
var new_array = your_array[0].split(',');//["500,505,506...."]
console.log(new_array);//[500,505,506]

Drawing a line between two words in the page? [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 7 years ago.
Improve this question
I have a page full of text with repetitive words, and I need to find a way to map the similar words together by drawing a line between them. (it doesn't matter if it crosses the word or if it goes around it).
What is the best way/library to do that using javascript/jquery?
The text is fixed, and the line drawing is the dynamic part. (depending on the word you choose).

AMCharts candlestick chart, show entry/exit arrow [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 3 years ago.
Improve this question
Is it possible to show a little arrow at a specific price and time, indicating entries and exits in an AMChart? Something like:
If not, is there at least a way of creating custom drawing elements in the chart (circles, lines, squares) similarly to this but using a candlestick chart, not a line chart?
If none of that is possible, does anybody know about a JS library that's capable of doing so?
Thank you!
You can use events for this purpose: http://www.amcharts.com/demos/stock-events/
In the demo it's line chart,but events can be used with candlesticks as well.

Categories

Resources