Show some labels without constantly. Draw single line with several colors.

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 Vladimir on 12th November 2012
Hello. I'm trying to use RGraph to build custom chart.
Everyting is very good.
Got several questions. Let's imagine that I'm using www.rgraph.net/demos/line01.html simmilar graph.
1) How can I draw with line with several colors(to show dinamic, for example blue -- when it decreases and green when it grows)
2) How can I constatly show label with Maximum value?

Regards,
Vladimir
Posted by RGraph support on 13th November 2012
Hi,

1. You can use the chart.colors/alternate for this.

2. Not quite understanding what you mean here, though you can use the ondraw custom event to draw on the canvas yourself - and the maximum Y value is stored in the obj.ymax variable:

line.ondraw = function (obj)
{
     alert(obj.ymax);
}
Posted by Vladimir on 13th November 2012
Tnx a lot for quick response.
Great solution with 1 question. I've saw a lot of chart controls, non of them has it.
Second question clarification.
Graph like this [removed] have labels on each value.
But to show it I need to hover to the point.
I want to constantly show label with biggest value. In out case it's value on September-60


Regards,
Vladimir
Posted by RGraph support on 13th November 2012
Hi,

You can do that by first determining the largest value, and then adding at marker at the points coordinates, eg the Marker2 object that is shown here:

www.rgraph.net/docs/drawing-api-marker2.html
Posted by Vladimir on 13th November 2012
Tnx a lot.

Add a reply




« Back to message list