RGraph: HTML5 canvas graph library - Available CSS classes

This is information about a few CSS classes available to you to allow you to customise the appearance of tooltips and context menus.

  1. RGraph_tooltip
  2. RGraph_contextmenu
  3. RGraph_contextmenu_item
  4. RGraph_contextmenu_background
  5. An example usage
  6. ! important

1. RGraph_tooltip

This controls the appearance of tooltips. The default is to have them look like Windows tooltips.

2. RGraph_contextmenu

This controls how context menus appear. The default is similar to the look that Windows XP has.

3. RGraph_contextmenu_item

This controls how individual items on the context menu will appear, for example the default has roughly 25px padding-left to accomodate the left bar.

4. RGraph_contextmenu_background

This is the Windows XP style left vertical bar. By default this is light grey.

Example usage

Here is an example of using the CSS classes. At the time of writing, some of the items here were only implemented in newer web browsers:

<style type="text/css">
    .RGraph_tooltip {
        border-radius: 5px;
        -moz-border-radius: 5px;
        -webkit-border-radius: 5px;
        -webkit-box-shadow: rgba(96,96,96,0.5) 3px 3px 3px;
        -moz-box-shadow: rgba(96,96,96,0.5) 3px 3px 3px;
        filter: progid:DXImageTransform.Microsoft.Shadow(color=#666666,direction=135);
    }
    
    .RGraph_contextmenu {
        -webkit-box-shadow: rgba(96,96,96,0.5) 3px 3px 3px;
        -moz-box-shadow: rgba(96,96,96,0.5) 3px 3px 3px;
        filter: progid:DXImageTransform.Microsoft.Shadow(color=#666666,direction=135);
    }
    
    .RGraph_contextmenu_background {
        background-color: #ddd ! important;
        border-right: 1px solid #ccc ! important;
    }
    
    .RGraph_contextmenu_item {
        font-weight: normal;
    }
</style>

! important

If you're attempting to override default styles, then because of the ordering (ie the script is setting the style AFTER your own CSS) you may need to use the "! important" modifier, as in the example above.