Tunable ticks of odometer


« 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
Hello,
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
10d9
< /* Modified by P. Malaise to support tunable steps for tick marks */
23c22
< RGraph.MyOdometer = function (id, start, end, value)
---
> RGraph.Odometer = function (id, start, end, value)
125,128d123
< 'chart.tickmarks.smallstep': 3,
< 'chart.tickmarks.mediumstep': 18,
< 'chart.tickmarks.bigstart': 18,
< 'chart.tickmarks.bigstep': 36,
446c441
< for (var i=0; i<=360; i+=prop['chart.tickmarks.smallstep']) {
---
> for (var i=0; i<=360; i+=3) {
464c459
< // Gray lines
---
> // Gray lines at 18 degree intervals
467c462
< for (var i=0; i<360; i+=prop['chart.tickmarks.mediumstep']) {
---
> for (var i=0; i<360; i+=18) {
636c631
< for (var i=prop['chart.tickmarks.bigstart']; i<=360; i+=prop['chart.tickmarks.bigstep']) {
---
> for (var i=18; i<=360; i+=36) {
1051c1046
< }
---
> }


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

I'll take a look into it.

Cheers.



Richard
www.rgraph.net
Please link to the RGraph website. Thanks!
Posted by Enter your name... on 6th January 2014
Hello,

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/

Regards
Posted by Richard on 6th January 2014
Hi there,

Thanks for the link. Are you replacing all of the charts with RGraph charts?

Cheers.




Richard
www.rgraph.net
Please link to the RGraph website. Thanks!
Posted by Enter your name... on 7th January 2014
Hello,

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.

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

I think I was looking at this:

malaise.mooo.com/meteo/MTO_h.dat.png



Richard, RGraph Support
www.rgraph.net
Please link to the RGraph website
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).
Regards
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
     }
}).draw()


Richard
If RGraph has helped you - please share the website and give your feedback - thanks:

www.rgraph.net/testimonials
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

Regards
Posted by Richard on 19th November 2015
Hi,

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.





Richard

Add a reply

 




« Back to message list
RGraph on social media