Key on combined chart

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« 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 James Brown on 5th March 2014
I can't get a key to be displayed on a combo graph with 1 bar chart and 2 line graphs. Below is a sample of my code. I have tried adding a simple key with a couple of keys to no avail. If you like to see what I'm working on go to instipics.com/graphit

             var bar = new RGraph.Bar('cvs2', monthlyPower1)
                 .Set('labels', monthlyLabels)
                 .Set('tooltips.event','onmousemove')
                 .Set('tooltips', monthlyToolTips1)
                 .Set('gutter.bottom',60)
                 .Set('text.angle',90)
                 .Set('linewidth', 0)
                 .Set('filled',1)
   .Set('colors',['#00a','#f70'])
   .Set('ymax',maxPower)
   .Set('numyticks',maxPower/5)
   .Set('ylabels.count',maxPower/10)
   .Set('background.grid.autofit.numhlines',maxPower/5)
   .Set('background.grid.vlines',false)
    
             var line = new RGraph.Line('cvs2', [avgConsumed,avgConsumed])
   .Set('noaxes', true)
   .Set('linewidth', 1)
   .Set('colors', ['#d00'])
   .Set('ymax',maxPower)
   .Set('linewidth', 2)
     
             var line1 = new RGraph.Line('cvs2', [avgGenerated,avgGenerated])
   .Set('noaxes', true)
   .Set('linewidth', 1)
   .Set('colors', ['#0f0'])
   .Set('ymax',maxPower)
   .Set('linewidth', 2)
     
      var combo = new RGraph.CombinedChart(bar, line, line1);
   combo.Draw();
Posted by Richard on 5th March 2014
Hi there,

Well you haven't specified a key that I can see or even included the key library file - RGraph.common.key.js.



Richard, RGraph Support
www.rgraph.net
If RGraph has helped you - please share the website - thanks!

Add a reply




« Back to message list