It is currently Fri Nov 21, 2014 12:35 am Advanced search

Range Line Marker for Scatter Chart

Technical support, bug reports and more.

Re: Range Line Marker for Scatter Chart

Postby tredington » Wed Feb 22, 2012 5:07 pm

ok, right, it's destroying it many times. hmm, i am trying to destroy group_init (once) when you zoom. Is there a callback or something for zoom i can use to destroy the group?
tredington
 
Posts: 109
Joined: Tue Sep 06, 2011 4:42 pm

Re: Range Line Marker for Scatter Chart

Postby Fusher » Wed Feb 22, 2012 5:13 pm

Paweł Fus
Highcharts support team
Fusher
 
Posts: 7502
Joined: Mon Jan 30, 2012 12:16 pm

Re: Range Line Marker for Scatter Chart

Postby tredington » Wed Feb 22, 2012 5:41 pm

Hmm, i think i was able to destroy the group with:

Code: Select all
events:{
                       selection:function(event){
                          group_init.destroy();
                       }


However, it didn't remove the paths. I know it's doing something as it breaks the zoom whereas hide() does not.
tredington
 
Posts: 109
Joined: Tue Sep 06, 2011 4:42 pm

Re: Range Line Marker for Scatter Chart

Postby Fusher » Wed Feb 22, 2012 6:13 pm

Can you share with code?
Paweł Fus
Highcharts support team
Fusher
 
Posts: 7502
Joined: Mon Jan 30, 2012 12:16 pm

Re: Range Line Marker for Scatter Chart

Postby tredington » Wed Feb 22, 2012 6:55 pm

Here is the link:

http://www.law.com/jsp/tal/PubArticleTAL.jsp?id=1202543147052

As you can see, I am drawing the init paths on the callback function for the new Highcharts. I would like to destroy those on zoom and redraw new paths based on the zoom(which also works) and etc for each time you zoom or reset zoom.
tredington
 
Posts: 109
Joined: Tue Sep 06, 2011 4:42 pm

Re: Range Line Marker for Scatter Chart

Postby Fusher » Wed Feb 22, 2012 7:30 pm

Don't you forget in .add() pass the variable for group ? ;)
Code: Select all
this.series.chart.renderer.path(['M', xpos+105, ypos+15, 'L', xpos+105, my+15]).attr({'stroke-width': 1, stroke: '#999'}).add(yourGroupVariable);


Btw, nice!
Paweł Fus
Highcharts support team
Fusher
 
Posts: 7502
Joined: Mon Jan 30, 2012 12:16 pm

Re: Range Line Marker for Scatter Chart

Postby tredington » Wed Feb 22, 2012 7:36 pm

Thanks! Although, not using group yet. 1st trying to destroy group_init. Any reason that's not working?
tredington
 
Posts: 109
Joined: Tue Sep 06, 2011 4:42 pm

Re: Range Line Marker for Scatter Chart

Postby Fusher » Thu Feb 23, 2012 2:17 pm

Not sure, but 'option.renderer.g().add() ' -> options propably doesn't have renderer.
You can try achieve this another way: http://jsfiddle.net/CDnes/
Paweł Fus
Highcharts support team
Fusher
 
Posts: 7502
Joined: Mon Jan 30, 2012 12:16 pm

Re: Range Line Marker for Scatter Chart

Postby tredington » Thu Feb 23, 2012 9:25 pm

Hmm, i tried:

options.chart.renderer.path(['M', xpos+105, ypos+5, 'L', xpos+105, my+5]).attr({'stroke-width': 1, stroke: '#ad2b2b'}).add(group_init);

instead of:

options.renderer.path(['M', xpos+105, ypos+5, 'L', xpos+105, my+5]).attr({'stroke-width': 1, stroke: '#ad2b2b'}).add(group_init);

To draw the paths and nothing happened. Are you sure options doesn't have a renderer?
tredington
 
Posts: 109
Joined: Tue Sep 06, 2011 4:42 pm

Re: Range Line Marker for Scatter Chart

Postby Fusher » Fri Feb 24, 2012 2:26 pm

I setup almost like your example in jsbin: http://www.highcharts.com/jsbin/oyadep/4/edit - of course there must be checking if point is inside of plot area.
After all event:redraw is better option than event:selection. Why in your case it wasn't work? Not sure.. maybe because creating twice in loop with maxItems? Or maybe you are try to draw this path twice?
Paweł Fus
Highcharts support team
Fusher
 
Posts: 7502
Joined: Mon Jan 30, 2012 12:16 pm

Re: Range Line Marker for Scatter Chart

Postby tredington » Fri Feb 24, 2012 5:29 pm

Awesome! yes, it was because i had the group_init = ...add() inside the for loop, so i was drawing many times. Also didn't need to redraw in the zoom formatter, just in the external function. Thanks!
tredington
 
Posts: 109
Joined: Tue Sep 06, 2011 4:42 pm

Previous

Return to Highcharts Usage

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 9 guests