PDA

View Full Version : Vertical line for current date In Extjs line chart



gnabhan
13 Feb 2013, 3:24 AM
41796


How to set vertical line for current date looks like chart image. Please update me

scottmartin
14 Feb 2013, 11:30 AM
Have a look at the following:
http://www.sencha.com/forum/showthread.php?236137

Scott.

gnabhan
19 Feb 2013, 8:58 PM
If click above link then showing following message,

gnabhan, you do not have permission to access this page. This could be due to one of several reasons:



Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Please tell me how to see your thread

scottmartin
20 Feb 2013, 5:05 AM
The thread is for premium member support. Please try:
http://jsfiddle.net/h58BZ/

Scott.

gnabhan
20 Feb 2013, 9:43 PM
Thanks for your reply. I'm new to extjs chart. I want to show only vertical line for current date from X-axis. Please refer below attached image.
41973

gnabhan
28 Feb 2013, 3:52 AM
Hello,

I'm new to Extjs. Above you mentioned example had horizontal bar for Y-axis. But I want to display vertical bar based on X-axis value. Can you guide me to display vertical bar for current date or give any functions or sample demo url.

andyjc
8 Jul 2013, 3:25 AM
I would find this very useful too. Did you find any way to do this?

Thanks,

Andy

wared
1 Oct 2013, 2:01 AM
Try to add this event handler to your series config :


afterrender: function () {
var c = this.chart,
yAxis = c.axes.items[0],
xAxis = c.axes.items[1];
x = xAxis.x + Math.floor(xAxis.length * 30 / xAxis.to) + 1;
c.surface.add({
'type': 'path',
'stroke': '#f00',
'stroke-width': 1,
'path': [
'M' + x + ' ' + yAxis.y,
'V' + (yAxis.y - yAxis.length + 2) + ' Z'
].join(' ')
}).show(true);
return this.callParent(arguments);
}

Replace "30" with the x value where you want to position the line.

I started from there : http://stackoverflow.com/questions/13254593/highlight-a-part-of-an-extjs4-line-chart.

tanzir
13 Nov 2013, 12:30 AM
It didn't work for me:-|. I'm using ExtJS line examples - http://docs.sencha.com/extjs/4.1.3/extjs-build/examples/charts/Line.html. Wanted to show the same line what gnabhan was saying. I tried both the above example and the one on stackoverflow. Didn't work for me.

Any information will be highly appreciated.


Thanks