Draw vertical lines only on X axis labels ticks

Share RGraph:   Share or Like RGraph on Facebook!

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by PauloASilva on 26th April 2013
Hi all,
I would like to draw a vertical dashed line only on xAxis labels ticks, but I'm not being able to accomplish that.

I'm using data/time based Scatter chart with custom 'chart.labels'.

Any help from you will be appreciated.
Thanks in advance,
Paulo A. Silva
Posted by RGraph support on 26th April 2013
Hi there,

You can draw vertical dashed lines but you'll need to use the API.

Richard
Posted by PauloASilva on 26th April 2013
Hi Richard,
Thanks for your reply (and example!).

I'm trying to do the same with a date/time based scatter and the result is not the same.

It is correct to use the date/time value as xAxis coordinate to the dashed line?
Posted by RGraph support on 26th April 2013
Hi there,

No - but you might be able to use this as one of the arguments to the function:

Date.parse('2013/02/03')




Richard, RGraph Support
Posted by PauloASilva on 26th April 2013
Richard,
It works like a charm.

It is my first time with RGraph and as an experienced web developer I'm having lots of troubles because of lack documentation.

From what I could see your source code has lots of inline documentation (Javadoc like). Why not to generate an online API?

And now the most important: how can I help you about that?
Posted by RGraph support on 26th April 2013
Hi there,

You're the first person in 5 years to mention *lack* of documentation. If you need API information there's the API docs here:

www.rgraph.net/api



Richard, RGraph Support
Posted by PauloASilva on 26th April 2013
Richard,
*lack* was not the right work, I do agree.

I'm missing a search engine on the RGraph website and some source code tree and JsDoc like documentation, but you're absolutly doing a great work with RGraph.

Thanks for your help.
Posted by PauloASilva on 30th April 2013
Hi Richard,
As I told you early I was able to draw the desired vertical lines on each xAxis label, but now I'm experiencing a different problem: every time a tooltip is shown or hidden the vertical bars are removed.

I was doing some step-by-step debug and I think that when the tooltip is "closed" all the graph is redrawn.

I was looking for an event like ondraw (www.rgraph.net/docs/howto-dom1-events.html) but it seems that it is never triggered.

Can you provide me some help.
Thanks in advance,
Paulo A. Silva
Posted by RGraph support on 30th April 2013
Hi there,

You were absolutely correct with the ondraw event - though remember that you need to add it before you draw the chart initially or you won't get the dashed line.






Richard
Posted by PauloASilva on 2nd May 2013
Hi Richard,
Perfect: it really does the job.

I have a last question for you.
I'm using the Scatter chart but I was requested to fill the area below the line. I did it easily walking through each tick and closing the the path with some extra dots.

My problem is that the filled area comes on top of ticks.

There is some way to manage the "layers" order or make my fillArea() function to run before the tick and line drawing?

Thanks,
Posted by RGraph support on 2nd May 2013
Hi there,

There's nothing like that I'm afraid - the Scatter chart doesn't support filled lines.



Richard, RGraph Support
Posted by PauloASilva on 2nd May 2013
Richard,
Let me provide you some pictures about what I was talking.

dev.pauloasilva.com/rgraph/scatter.png
As you can see the filled shape, overlaps the chart tickmarks. There's a way to avoid that?

Thanks for your kind help,
Paulo A. Silva
Posted by RGraph support on 3rd May 2013
Hi there,

Because of the sequential drawing nature of canvas you need to redraw the the tickmarks on the chart *after* you do the fill. You could do this using the ondraw event or simply do it after the fill that you're doing.



Richard

Add a reply




« Back to message list