I have a question about the Bar chart

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 Bob on 3rd January 2013
when I use a Bar RGraph, I have a problem.

In Bar graph,

when I clicked any bar,

Is it possible to see pop-ups about domain address ???

such as window.open('www.google.com/') in JavaScript.

 

Thank you.
Posted by RGraph support on 3rd January 2013
Hi,

> when I use a Bar RGraph, I have a problem.
>
> In Bar graph,
>
> when I clicked any bar,
>
> Is it possible to see pop-ups about domain address ???
>
> such as window.open('www.google.com/') in JavaScript.

Yes there's a few options:

1. Tooltips - add all of the information to tooltips.
2. Use the chart.events.click option to specify a function that should
be run when a bar is clicked. This function can then open the new
window for you. Eg:

function myFunc (e, obj)
{
     // window.open()
}
obj.Set('chart.events.click', myFunc);

There are a few alternative ways of doing this:

obj.onclick = function (e, shape)
{
     // This function runs when any bar is clicked
     // so put the wundow.open here
}

And:

obj.$2.onclick = function (e, shape)
{
     // This function runs when the THIRD bar is clicked
}

There's a summary of events options here:

www.rgraph.net/docs/events-summary.html
Posted by Ankit on 1st February 2013
I have an array called RGValues where I am getting dynamic value in the following format [,,,,,2,,1,,2,,,] and wanted to plot graph
Please give some important suggestion.
Posted by RGraph support on 1st February 2013
Hi,

Suggestions for what? The chart type? Well with a Line chart you'd need at least two consecutive values - so with your data you should opt for a Bar chart.


Richard, RGraph Support

Add a reply




« Back to message list