How to specify a different color

Asked by Hanh Nguyen

Hi,
 I use Jarmon for graphing different Oracle waits (some kind of light Grid control).
 I want to know if we can specify a different color than the default one

 Thanks for you work

Best Regards

Hanh

Question information

Language:
English Edit question
Status:
Solved
For:
Jarmon Edit question
Assignee:
No assignee Edit question
Solved by:
Hanh Nguyen
Solved:
Last query:
Last reply:
Revision history for this message
Richard Wall (richardw) said :
#1

Hi Hanh,

Sorry for delayed reply.

I think you should be able to pass any valid Flot configuration into the jarmon graph by adding it to the options section in your recipe file.

https://bazaar.launchpad.net/~richardw/jarmon/trunk/view/head:/docs/examples/jarmon_example_recipes.js#L28

I haven't worked on Jarmon for over a year, but I'm hoping to revisit it in the next few weeks at which point I'll try this out for myself.

Glad you find it useful.

-RichardW.

Revision history for this message
Hanh Nguyen (hhng71) said :
#2

Hi,
 not a problem for the delay, I understand that.
 I don't understand where to put my colors array
 I try this syntax below but it doesn't seem to work

   'oraash': {
        title: 'ASH history',
        data: [
<?php
            echo "['ASH/$LaBase/aas.rrd', 'cpu', 'CPU',''],";
            echo "['ASH/$LaBase/aas.rrd', 'bcpu', 'BCPU', ''],";
            echo "['ASH/$LaBase/aas.rrd', 'cpu_ora_wait', 'CPU ORA WAIT', ''],";
            echo "['ASH/$LaBase/aas.rrd', 'scheduler', 'Scheduler', ''],";
            echo "['ASH/$LaBase/aas.rrd', 'uio', 'User IO', ''],";
            echo "['ASH/$LaBase/aas.rrd', 'sio', 'System IO', ''],";
            echo "['ASH/$LaBase/aas.rrd', 'concurrency', 'Concurrency', ''],";
            echo "['ASH/$LaBase/aas.rrd', 'application', 'Application', ''],";
            echo "['ASH/$LaBase/aas.rrd', 'commit', 'Commit', ''],";
            echo "['ASH/$LaBase/aas.rrd', 'configuration', 'Configuration', ''],";
            echo "['ASH/$LaBase/aas.rrd', 'administrative', 'Administrative', ''],";
            echo "['ASH/$LaBase/aas.rrd', 'network', 'Network', ''],";
            echo "['ASH/$LaBase/aas.rrd', 'queueing', 'Queueing', ''],";
            echo "['ASH/$LaBase/aas.rrd', 'clust', 'Cluster', ''],";
            echo "['ASH/$LaBase/aas.rrd', 'other', 'Other', '']";
?>
        ],
        options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS,
                                         jarmon.Chart.STACKED_OPTIONS, {colors: ["#00CC00","#92D050","#7F9A48","#C3D69B","#0000FF","#00B0F0","#8B1A00","#C0504D","#E46C0A","#4A452A","#948A54","#C4BD97","#DDD9C3","#EEECE1","#FF33CC"]})
    },

 Thank you for your time.

 Hanh

Revision history for this message
Hanh Nguyen (hhng71) said :
#3

Hi,
 I speak too fast, just try this syntax

  options: jQuery.extend(true, {colors: ["#00CC00","#92D050","#7F9A48","#C3D69B","#0000FF","#00B0F0","#8B1A00","#C0504D","#E46C0A","#4A452A","#948A54","#C4BD97","#DDD9C3","#EEECE1","#FF33CC"]}, jarmon.Chart.BASE_OPTIONS,
                                         jarmon.Chart.STACKED_OPTIONS)

 And It works.
 Once again, thank you very much.
 Wish you the best.

 Hanh