last day (16 days later) » 

11:45 AM
3
A: how to create dots on a line in a d3 line chart

altocumulusYour use of d3.extent() as well as d3.max() is flawed. The functions provided to these methods are just accessors; there is no parameter i for an actual iteration. They are meant as a means to actually access the relevant data of the array, which was passed in as the first parameter. Because you ...

 
what you provided answer is one of alternative and best way to do this. same thing happen. still i have that issue. first value always use y=2 and x=1. can you please tell me the reason. if need i will give the other codes also.
creating line code part and other codes working perfectly, issues only with the dot creation.
 
@BuddhikaAlwis What does your actual data look like? The first sample you provided (right under the image) actually had an x=1, y= 2... Are you sure, it starts off with some other value?
 
This is the json data for the graph. // var dataset = [ { label: "Execution 1 - buddhika@gmail.com", // x: [1,2,3,4,5,6], // y: [2,1,1,1,1,1] }] ; but these json data change time to time. Y hats mean it create few graphs witg few aterations
Yep positive about that. I checked few graphs. All are start with that y=2 and x=1 cordinates.
First dot's cx and cy values are always (0,0) that is the issue
 
@BuddhikaAlwis I am confused right now... What is the expected behavior and what is the error? The image seems to be alright, at least does it correspond to the data you provided. Please set up an executable demo showing the effect. It would be much easier to help if there was some code to fiddle around with.
 
expected behaviour is first dot of the graph should place in the "FAILED". not in the "PASSED". in this graph's line start with the "FAILED". but first dot it start with the "PASSED". it is wrong . i need to place the first dot in the FAILED. here first dot hasnt correct coordinates. i cant understand what is the reason for that. json data and circle coordinates are not match.
still i am interest a answer from you.
 
11:45 AM
@BuddhikaAlwis Have you seen my update from earlier today? It has an analysis and a solution for your misplaced dots. Please re-read the answer, especially the last part starting at "Besides these technical shortcomings...".
 
hi, can you chek the feddle
if you give me a better answer for this, i will get your answer instead JAVA developers answer
 
12:28 PM
What other information do you need? I updated my answer with a full analysis on what is going wrong with your code and why this is happening. I also proposed a solution by setting y.domain([1, 3]);. If you change this one line, your code should be running fine.
 
 
1 hour later…
1:46 PM
Have a look at the updated JSFiddle where I changed just that one line. This works as expected.
I have also moved that working code as a Stack Snippet into my answer.
 

  last day (16 days later) »