Change y-Axis Scaling

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
sn
Posts: 4
Joined: Mon Nov 23, 2009 4:07 am

Change y-Axis Scaling

Post by sn »

Hello,

I'm using the latest cacti 0.8.7e.

I've created my own simple Data Input Method, Data Source and Graph.

As you can see on the image below the scale interval is 100. I'd like to change the interval to 50 or 20.

I've found cool article that work (test case), but when I change the source code in libs/rrd.php there is no effect on my graph. But other graphs for instance my graph for "Localhost - Traffic - eth0" changed as I didn't what it to be changed. Is there any way I can change y-Axis Scaling?

What I've done?
Disabled this part of this code:

Code: Select all

	 if (!empty($graph["unit_value"])) {
                if (read_config_option("rrdtool_version") != "rrd-1.0.x") {
                        $unit_value = "--y-grid=" . $graph["unit_value"] . RRD_NL;
                }else{
                        $unit_value = "--unit=" . $graph["unit_value"] . RRD_NL;
                }
        }
        if (ereg("^[0-9]+$", $graph["unit_exponent_value"])) {
                $unit_exponent_value = "--units-exponent=" . $graph["unit_exponent_value"] . RRD_NL;
        }
I've set manually:

Code: Select all

$unit_value = "--alt-y-grid"
RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Ilosc katalogow w poszczegolnych sciezkach" \
--alt-y-grid \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
--font TITLE:10:/usr/share/fonts/truetype/msttcorefonts/Verdana.ttf \
--font AXIS:8:/usr/share/fonts/truetype/msttcorefonts/Verdana.ttf \
--font LEGEND:8:/usr/share/fonts/truetype/msttcorefonts/Verdana.ttf \
--font UNIT:8:/usr/share/fonts/truetype/msttcorefonts/Verdana.ttf \
DEF:a="/home/stats/public_html/statystyki/rra/localhost_internal_source_dir_87.rrd":internal_source_dir:AVERAGE \
DEF:b="/home/stats/public_html/statystyki/rra/localhost_internal_dir_arch_89.rrd":internal_dir_arch:AVERAGE \
DEF:c="/home/stats/public_html/statystyki/rra/localhost_dit_ext_88.rrd":dit_ext:AVERAGE \
DEF:d="/home/stats/public_html/statystyki/rra/localhost_ext_arch_90.rrd":ext_arch:AVERAGE \
LINE1:a#FF0000FF:"/internal" \
GPRINT:a:LAST:" Current\:%8.2lf %s" \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:b#D8ACE0FF:"/internal/archive" \
GPRINT:b:LAST:"Current\:%8.2lf %s" \
GPRINT:b:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:c#00FF00FF:"/external" \
GPRINT:c:LAST:" Current\:%8.2lf %s" \
GPRINT:c:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:d#4444FFFF:"/external/archive" \
GPRINT:d:LAST:"Current\:%8.2lf %s" \
GPRINT:d:MAX:"Maximum\:%8.2lf %s\n"

RRDTool Says:

OK
Attachments
graph_image.php.png
graph_image.php.png (16.48 KiB) Viewed 1725 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Your "patch" unconditionally changes every graph to --alt-y-grid which is obviously not exactly what you need to have.
Adding this option is not that big of a deal but will require a table change so it will NOT be part of a patch due to our patch policy
R.
sn
Posts: 4
Joined: Mon Nov 23, 2009 4:07 am

Post by sn »

gandalf wrote:Your "patch" unconditionally changes every graph to --alt-y-grid which is obviously not exactly what you need to have.
Adding this option is not that big of a deal but will require a table change so it will NOT be part of a patch due to our patch policy
R.
Can I expect that this option will be available in next release of Cacti?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

It is already in SVN
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests