I've added tunable tick marks to the Odometer chart

« 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 Pascal Malaise on 5th January 2014
I needed to customize the period of ticks of the odometer.
This is the delta from RGraph 2013-12-31-stable:
diff RGraph.myodo.js rgraph/RGraph.odo.js
< /* Modified by P. Malaise to support tunable steps for tick marks */
< RGraph.MyOdometer = function (id, start, end, value)
> RGraph.Odometer = function (id, start, end, value)
< 'chart.tickmarks.smallstep': 3,
< 'chart.tickmarks.mediumstep': 18,
< 'chart.tickmarks.bigstart': 18,
< 'chart.tickmarks.bigstep': 36,
< for (var i=0; i<=360; i+=prop['chart.tickmarks.smallstep']) {
> for (var i=0; i<=360; i+=3) {
< // Gray lines
> // Gray lines at 18 degree intervals
< for (var i=0; i<360; i+=prop['chart.tickmarks.mediumstep']) {
> for (var i=0; i<360; i+=18) {
< for (var i=prop['chart.tickmarks.bigstart']; i<=360; i+=prop['chart.tickmarks.bigstep']) {
> for (var i=18; i<=360; i+=36) {
< }
> }

Maybe you can add this feature to the product.
Posted by RGraph support on 5th January 2014
Hi there,

I'll take a look into it.


Posted by Enter your name... on 6th January 2014

you can have a look at the overall result (including the modified odometer and the reference to RGraph home page) at malaise.mooo.com/meteo/

Posted by Richard on 6th January 2014
Hi there,

Are you replacing all of the charts with RGraph charts?


Posted by Enter your name... on 7th January 2014

I don't understand your question:
All the charts of this page are based on RGraph.
I don't plan to add more charts or new pages.

Posted by RGraph support on 7th January 2014
Hi there,

I think I was looking at this:


Posted by Enter your name... on 7th January 2014
Ah, ok the question is clear now :-)
The answer is no (these images are generated by gnuplot and I intend to keep them like that).
Posted by malaise on 18th November 2015
Now I am starting to add a new page (with Temperature and Pressure history of the week) with RGraph scatter.
The goal is to provide tooltips indicating the coords (date, value) of the point.
Posted by Richard on 18th November 2015
Hi there,

Then you can use the tooltips feature of the Scatter chart. Build the tooltips array up first using your data and then pass it to the Scatter chart like this:

var scatter = new RGraph.Scatter({
     id: 'cvs',
     data: myData,
     options: {
         xmax: 365,
         labels: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],

         // After building your tooltips array - give it to your Scatter chart here
         tooltips: myTooltips

Posted by malaise on 19th November 2015
Well, we are going off topic from the title... still, thank you for the recommendation.

Is there a difference between this way of setting tootltips and defining them in the data of the Scatter (4th field of each data)?

I guess no, because I see the tooltips in malaise.hd.free.fr/meteo/TempPress.html

Posted by Richard on 19th November 2015

No. Or at least I'm pretty sure that there's not.

In the .draw() function of the Scatter you'll see that there is code that gets all the tooltips from the data and populates the tooltips array.

In fact setting the tooltips array yourself might not work if you take the tooltips out of the data - as this code may overwrite the tooltips configuration property.

So I may need to add a check or flag so that doesn't happen. Try taking the tooltips out of the data array and see.


Add a reply

« Back to message list